Jujo Posted April 22, 2009 Share Posted April 22, 2009 Hi again, I need help for my program. I want to have function called on key press (e.g. Left arrow), but to exit function and call another one when that key is released. I now use HotKeySet, but I can't use it with key release: HotKeySet("{LEFT}", "left") HotKeySet("{RIGHT}", "right") HotKeySet("{UP}", "up") HotKeySet("{DOWN}", "down") HotKeySet("{SPACE}", "wait") I want that while {LEFT} is pressed, the left() function is called, and when {LEFT} is released, up() is called back. Thanks Link to comment Share on other sites More sharing options...
Valuater Posted April 22, 2009 Share Posted April 22, 2009 (edited) This is a working piece of code, just needs the include ( see help) If _IsPressed("01", $hUser32_Dll) Then ;Waiting untill the button is released While _IsPressed("01", $hUser32_Dll) Sleep(10) WEnd change the "01" to the key number you want 8) Edited April 22, 2009 by Valuater Link to comment Share on other sites More sharing options...
Jujo Posted April 22, 2009 Author Share Posted April 22, 2009 Thanks, hope it works Link to comment Share on other sites More sharing options...
Jujo Posted April 22, 2009 Author Share Posted April 22, 2009 (edited) I tried this, but I get error, I think that I need to include a DLL, but dont know where and which... ERROR: If _IsPressed("{LEFT}", $hUser32_Dll) Then If _IsPressed("{LEFT}", ^ ERROR EDIT: I looked help and included the misc.aue3 file like in help example, but still the same error EDIT2: I changed {LEFT} to 25, like the help says. Still error. Error says "Variable used without beign declared". It means $hUser32_DLL variable Edited April 22, 2009 by Jujo Link to comment Share on other sites More sharing options...
Jujo Posted April 22, 2009 Author Share Posted April 22, 2009 Never mind, it works perfectly now Thanks once again Link to comment Share on other sites More sharing options...
Elettrone Posted April 28, 2009 Share Posted April 28, 2009 Share it pls, how did you get it working. 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