Azu Posted November 1, 2006 Share Posted November 1, 2006 You know how in some applications there is an option to bind a key, and it says to press the key you wanna use, and it knows which one you pressed? How do I do this in autoit? Would I have to make if conditions for every single key on the keyboard (which would be retarded), or is there a way for it to tell which key is pressed? Link to comment Share on other sites More sharing options...
cppman Posted November 1, 2006 Share Posted November 1, 2006 (edited) HotKeySet()? #include <misc.au3> while 1 For $i = 0 to 255 if (_IsPressed(Hex($i, 2))) Then MsgBox(0, "", "You pressed " & Chr($i)) Next WEnd maybe? then of course handle the key accordingly... if (Chr($i) == "A")... PlaySong().. Edited November 1, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Azu Posted November 1, 2006 Author Share Posted November 1, 2006 Thanks. It seems to work with every key on my keyboard. One problem though, it gets them mixed up :s With the a-z and 0-9 keys it gets them all perfect, but with ctrl, alt, shift, caps lock, tab, tilde, backspace, and all the G keys on the G15, it displays some kind of ASCII symbol which isn't on my keyboard.. (like the kind you can make with alt+numpad keys) Why is this happening? It probably isn't really a problem, since it detects it persistently, but it's piqued my curiosity. O_o 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