Sign in to follow this  
Followers 0
Eigensheep

Capturing enter key

5 posts in this topic

Seems like a simple question but I can't find any other topics on it. Basically I'd like to call, for example, Func1 when the user hits the enter button inside a GUICtrlCreateInput, but I can't find how to do this. Using GUICtrlSetOnEvent() doesn't seem to work, nor will it inside a loop-type GUI event.

The help file says "if you do not specify this style [$ES_WANTRETURN], pressing the ENTER key has the same effect as pressing the dialog boxs default push button." I'm thinking maybe creating a button that a user can't see? Would this work?

Share this post


Link to post
Share on other sites



you could use _isPressed or hotkeyset to do something when the specific key is pressed

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the idea - I had thought of that, but I have multiple input boxes on the GUI and I only want the function to run when Enter is pressed in one of them. I suppose I could use GUICtrlGetState...

[edit: Tried using If GUICtrlGetState($control) = $GUI_FOCUS Then... but it doesn't work. Any other ideas? Again, thanks for the reply.]

Edited by logicBird

Share this post


Link to post
Share on other sites

Seems like a simple question but I can't find any other topics on it. Basically I'd like to call, for example, Func1 when the user hits the enter button inside a GUICtrlCreateInput, but I can't find how to do this. Using GUICtrlSetOnEvent() doesn't seem to work, nor will it inside a loop-type GUI event.

The help file says "if you do not specify this style [$ES_WANTRETURN], pressing the ENTER key has the same effect as pressing the dialog boxs default push button." I'm thinking maybe creating a button that a user can't see? Would this work?

http://www.autoitscript.com/forum/index.ph...st&p=535977

Share this post


Link to post
Share on other sites

Oh, thanks :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0