Jump to content

GUICtrlCreateInput and pressing enter key


jftuga
 Share

Recommended Posts

My program uses Opt ("GUIOnEventMode", 1) and I create an input box with GUICtrlCreateInput().

After the user types something in, how can I make it so that an event is fired when the Enter key is pressed? I usually use GUICtrlSetOnEvent(), but this does not seem to catch the Enter key in the latest AutoIt beta.

Any ideas?

If it can not be done in GUIOnEventMode = 1, how do you accomplish this when it is = 0?

Thanks,

-John

Edited by jftuga
Link to comment
Share on other sites

Hello Guys,

This thread is closest to what I am looking for but being a newbie just the function does not really help me understand this script.

Func _IsPressed($hexKey);RETURNS 1 IF KEY IS PRESSED

    Local $aR

    $hexKey = '0x' & $hexKey

    $aR = DllCall($DLLuser32, "int", "GetAsyncKeyState", "int", $hexKey)

    If Not @error And BitAND($aR[0],0x8000) = 0x8000 Then Return 1

    Return 0

EndFunc  ;==>DETERMINE IF A PARTICULAR KEY IS PRESSED

How do I implement this func so that after the input has been entered the "OK" button is in focus and by clicking "ENTER" it automatically submits data?
Link to comment
Share on other sites

Hello Guys,

This thread is closest to what I am looking for but being a newbie just the function does not really help me understand this script.

How do I implement this func so that after the input has been entered the "OK" button is in focus and by clicking "ENTER" it automatically submits data?

<{POST_SNAPBACK}>

GUICtrlSetState($OKbutton,$GUI_DEFBUTTON) ; Adds data when Enter pressed.

hth

Hardcopy

Edited by HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

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...