kalayaan Posted June 10, 2004 Posted June 10, 2004 hi all, I read somewhere in the forum that pressing the Enter key will return a click on the default button (the first control to be defined) . But I noticed in a gui i created that the escape key also behaves the same way. I might have missed something but could I somehow make ESC not behave that way? I realize that I could set ESC as a hotkey to call a function with nothing in it, but this will prevent other applications to detect ESC while the script is running. Help, please... Enter key works fine (returns a click on the default button) except when the focus is on a combo box, in which case nothing happens. Thanks for the help.
CyberSlug Posted June 10, 2004 Posted June 10, 2004 (edited) In the newest betas, Esc is supposed to close the GUI. In previous versions, I think Esc was the same as clicking the active (focused) button. You can un-register the Esc hotkey if another window becomes active--if you use a GuiMsg loop. Disclaimer: Coded from memory without testing: GuiCreate("MySample") GuiShow() While GuiMsg(0) <> -3 sleep(100) If WinActive("MySample") Then HotKeySet("{Esc}", "Foo");register hotkey Else HotKeySet("{Esc}");un-register EndIf ;rest of GuiMessage-handling goes here WEnd Exit Func Foo() EndFunc Edited June 10, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Administrators Jon Posted June 10, 2004 Administrators Posted June 10, 2004 ESC closes the GUI in the latest beta (GuiMsg() returns -3) Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
SlimShady Posted June 10, 2004 Posted June 10, 2004 (edited) In the newest betas, Esc is supposed to close the GUI. In previous versions, I think Esc was the same as clicking the active (focused) button. You can un-register the Esc hotkey if another window becomes active--if you use a GuiMsg loop. Disclaimer: Coded from memory without testing: GuiCreate("MySample") GuiShow() While GuiMsg(0) <> -3 sleep(100) If WinActive("MySample") Then HotKeySet("{Esc}", "Foo");register hotkey Else HotKeySet("{Esc}");un-register EndIf ;rest of GuiMessage-handling goes here WEnd Exit Func Foo() EndFuncI always use this piece of script to select all text in an editbox. You know what, I'll post a request for selecting all with CTRL+A in an editbox. Edited June 10, 2004 by SlimShady
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now