scriptjunkie Posted May 18, 2016 Share Posted May 18, 2016 I created a loop to check a field for information: While 1 _checker() sleep(25) WEnd Func _checker() ; read input box $data = GUICtrlRead($inp_box) if $data = "secretpass" then _allowin() else _invalid() endif endfunc I can't figure out how to wait until the user is done typing. The users will not be slow typers, so I just need like a 1-2 second wait between keypresses. Anyone have an idea of how to do this? Thanks for your input. Link to comment Share on other sites More sharing options...
Trong Posted May 18, 2016 Share Posted May 18, 2016 (edited) add a button, when finished then press on button for check! Edited May 18, 2016 by Trong Regards, Link to comment Share on other sites More sharing options...
johnmcloud Posted May 18, 2016 Share Posted May 18, 2016 ; Johnmcloud - 2016 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Global $iBegin, $fFlag = False $hGUI = GUICreate("Test", 325, 100) $cInput = GUICtrlCreateInput("", 10, 20, 300, 20) GuiSetState() GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch If $fFlag And TimerDiff($iBegin) > 3000 Then $fFlag = False MsgBox(64, "Error", "Timed out") EndIf WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF) Local $iCode = BitShift($wParam, 16) If $iIDFrom = $cInput And $iCode = $EN_CHANGE Then $iBegin = TimerInit() $fFlag = True If GUICtrlRead($cInput) = "secretpass" Then Exit MsgBox(64, "Congrats", "Done") EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_COMMAND guner7 1 Link to comment Share on other sites More sharing options...
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