Jump to content

Capturing enter key


Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...