dly Posted August 18, 2012 Posted August 18, 2012 Hi, How do you detect user press Enter key at the the end of the line and set action by content of it ? I have my gui with GUICtrlCreateInput on it . So far it is working ok by user type in control and click the button , but I would like to set it so user type in , press Enter key at the end of that line . The script then detect that , read content of input control then process dly
dly Posted August 18, 2012 Author Posted August 18, 2012 I just found it a way go around by set my button to default button with GUICtrlSetState(-1, $GUI_DEFBUTTON). But just curious , if I have more than one edit control in GUI , how to find out which edit control user just type in , press Enter at the end ?
JScript Posted August 18, 2012 Posted August 18, 2012 Try this: #include <GUIConstantsEx.au3> Example() Func Example() Local $iInput, $iENTER, $msg GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45) $iInput = GUICtrlCreateInput("", 10, 5, 300, 20) $iENTER = GUICtrlCreateDummy() Dim $AccelKeys[1][2] = [["{ENTER}", $iENTER]]; Set accelerators GUISetAccelerators($AccelKeys) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $iENTER MsgBox(4096, "Test", "[Enter] key is detected!") EndSelect WEnd EndFunc ;==>Example Regards, João Carlos. http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
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