 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Carcophan
Joined: 24 Dec 2008 Posts: 1308 Location: :noitacoL
|
Posted: Thu Mar 04, 2010 10:38 pm Post subject: Hitting Enter from editbox to launch sub/button [solved] |
|
|
I am sort embarassed becuase I cannot remember this, I had this working at one time, but cannot find the snippet that I need now.
Basically, while the curser is in an Edit field in a GUI, I would simply like to hit 'enter' to make it launch the associated button, rather than making the user click button_x.
I haven't had a need for this in a while, and can't seem to bring up the right kind of search terms. I know its painfully simple but just adding a gLable to the edit field doesnt work, as it runs the subroutine once user enters -any- data. Obvisouly we would want them to finish typing first befroe launching the sub.
Last edited by Carcophan on Thu Mar 04, 2010 11:22 pm; edited 1 time in total |
|
| Back to top |
|
 |
jpjazzy
Joined: 16 Feb 2010 Posts: 799 Location: SciTE
|
Posted: Thu Mar 04, 2010 10:42 pm Post subject: Re: Hitting Enter from editbox to launch sub/button |
|
|
Like this?
| Code: | Enter::
IfWinActive, (*Your wintitle*)
{
GuiControlGet, focused_control, FocusV
If (%focused_control% = *EDITBOX NAME*)
{
Goto, Enter
}
}
IfWinNotActive, (*Your wintitle*)
{
Send, {Enter Up}
Keywait, {Enter}
Send, {Enter Down}
}
Return |
Last edited by jpjazzy on Thu Mar 04, 2010 10:43 pm; edited 1 time in total |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Thu Mar 04, 2010 10:43 pm Post subject: |
|
|
Button | AHK Help File wrote: | | The example above includes the word Default in its Options to make "OK" the default button. The default button's action is automatically triggered whenever the user presses ENTER... |
|
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 1308 Location: :noitacoL
|
Posted: Thu Mar 04, 2010 11:20 pm Post subject: |
|
|
| jaco0646 wrote: | Button | AHK Help File wrote: | | The example above includes the word Default in its Options to make "OK" the default button. The default button's action is automatically triggered whenever the user presses ENTER... |
|
@jpjazzy: Not quite, but Thank you for your assistance anyway
@jaco, Thats what I was talking about, yes! I had everything except for the magic word 'defualt' in there the first time through.
Gui, Add, Button, x-1000 y-1000 Default gCheckAcctNum, OK  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|