thc Posted February 4, 2010 Share Posted February 4, 2010 I'm having trouble interpreting the return value. When I run this bit of script: ;2E DEL key $result = DllCall("user32.dll", "int", "GetAsyncKeyState", "int", 0x2E) MsgBox(0,"",$result[0]) With the del key down, I get -32767. Without the del key down, I get 0. Now, according to the MSDN, there are 2 bits. If the MSB is set then the key is down. But what is the MSB when the result is -32767??? Link to comment Share on other sites More sharing options...
Minikori Posted February 4, 2010 Share Posted February 4, 2010 http://msdn.microsoft.com/en-us/library/ms646293%28VS.85%29.aspx That's the function on MSDN, and it says that if the value is 0, then basically somethings wrong. Why don't you just use _IsPressed()? For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
thc Posted February 4, 2010 Author Share Posted February 4, 2010 (edited) Ok, thanks. I didn't know of the _isPressed function. But it still doesn't seem to be able to do what I want to do. Basically, I want to set a hotkey so that when I press it down, it does a MouseDown, and when I release the hotkey, it does a MouseUp. If anyone has any insights or code examples, I'd very much appreciate it. Thanks Edit: Ah, nevermind, I got it to work (code below). Thanks again #include <misc.au3> ; 2D INS key ; 2E DEL key hotkeyset("{ins}","null") While(1) sleep(100) if(_isPressed("2D")) then MouseDown("left") _clickhold() EndIf WEnd func _clickhold() while(_isPressed("2D")) sleep(100) WEnd MouseUp("left") EndFunc func null() EndFunc Edited February 5, 2010 by thc 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