AutoHotkey Community

It is currently May 27th, 2012, 4:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: March 4th, 2010, 11:38 pm 
Offline

Joined: December 24th, 2008, 3:25 am
Posts: 1401
Location: :noitacoL
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. :oops:


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 March 5th, 2010, 12:22 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 4th, 2010, 11:42 pm 
Offline

Joined: February 16th, 2010, 8:01 am
Posts: 800
Location: SciTE
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 March 4th, 2010, 11:43 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2010, 11:43 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2010, 12:20 am 
Offline

Joined: December 24th, 2008, 3:25 am
Posts: 1401
Location: :noitacoL
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 :P

@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 8)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Bing [Bot], rbrtryn and 67 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group