EricBBB Posted March 27, 2008 Posted March 27, 2008 Hey everyone, I just switched from Autohotkey to Autoit v3. So im learning all the differences between the versions of autoit and such. Anyways, Im not sure what happened to the getkeystate command or how its called on this version. But could one of you more experienced guys help me set up a loop that ends when the enter key is pressed. I noticed that all the loops in version 3 are do whiles or do untils. So im trying to DO SCRIPT UNTIL ENTER KEY PUSHED can i get some help with the loop code please?
weaponx Posted March 27, 2008 Posted March 27, 2008 Well we have both _IsPressed and HotKeySet. HotKeySet just binds a key to a functions, _IsPressed well...checks if a key is pressed.
EricBBB Posted March 27, 2008 Author Posted March 27, 2008 Well we have both _IsPressed and HotKeySet. HotKeySet just binds a key to a functions, _IsPressed well...checks if a key is pressed.But whats the description for enter? I dont know the ASCII stuff. I tried looking it up on microsoft that was a disaster. Would it look something like Until "Enter" _ispressed ?
Richard Robertson Posted March 27, 2008 Posted March 27, 2008 (edited) GetKeyState is also a native function on the Windows platform. You can call it yourself using DllCall. If you use HotKeySet, you would just call HotKeySet("{ENTER}", "MyFunc") While 1 ;do whatever WEnd Func MyFunc MsgBox(0, "Yay", "Yay") EndFunc Edited March 27, 2008 by Richard Robertson
weaponx Posted March 27, 2008 Posted March 27, 2008 The Ascii codes are in the help file under "Appendix". #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) TrayTip("I'm Waiting","Please press ENTER sometime today!!", 30) If _IsPressed("0d", $dll) Then MsgBox(0,"_IsPressed", "Enter Key Pressed") ExitLoop EndIf WEnd DllClose($dll)
EricBBB Posted March 27, 2008 Author Posted March 27, 2008 The Ascii codes are in the help file under "Appendix". #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) TrayTip("I'm Waiting","Please press ENTER sometime today!!", 30) If _IsPressed("0d", $dll) Then MsgBox(0,"_IsPressed", "Enter Key Pressed") ExitLoop EndIf WEnd DllClose($dll) Thanks for your help guys, sorry for being so new to this
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