stlobeli Posted March 24, 2007 Posted March 24, 2007 (edited) anyone knows how to wait for user key strokes and get the value?? just like C++ getch() method. Edited March 24, 2007 by stlobeli
Gollum Posted March 24, 2007 Posted March 24, 2007 anyone knows how to wait for user key strokes and get the value?? just like C++ getch() method._IsPressed ?
stlobeli Posted March 24, 2007 Author Posted March 24, 2007 _IsPressed ? no, _IsPressed does not wait for user key strokes, instead, it checks if user pressed the key specified in the key parameter,what i want is, a way to wait for a key press and then get the value of the pressed key. again, like getch() method in C or C++
Alek Posted March 24, 2007 Posted March 24, 2007 (edited) maybe something like this?? #include <Misc.au3> $x = 0 $var = 1 Do if $var = 253 then $var = 1 if _IsPressed(hex($var)) = 1 then $x = 1 Else $var = $var+1 EndIf until $x = 1 msgbox(0,"test","Hex number of the button pressed is: " &hex($var,2)) Edited March 24, 2007 by Alek [font="Impact"]Never fear, I is here.[/font]
stlobeli Posted March 24, 2007 Author Posted March 24, 2007 maybe something like this?? #include <Misc.au3> $x = 0 $var = 1 Do if $var = 253 then $var = 1 if _IsPressed(hex($var)) = 1 then $x = 1 Else $var = $var+1 EndIf until $x = 1 i did try the same logic like yours, but there are times when key press timing doesn't meet the key value in the _IsPressed, causing user to press the key two times or more, any other idea??
jvanegmond Posted March 24, 2007 Posted March 24, 2007 It's a long shot.. but you might want to take a look at MouseHook by Larry. github.com/jvanegmond
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