gagan512 Posted July 18, 2006 Posted July 18, 2006 Hi, I had posted this in another topic but it was suggested that I start a new topic. Here's what i want: ---------------------------------------------------------------------------------------------------------------------------- i had a question relating 'multimedia' keys on keyboards. is there a way to read the raw hex code that they return when pressed? Reason i want to know: my multimedia keyboard has media buttons like "play/pause/next track....." but they only work with media player. i want them to work with winamp, and other media players. so i wanted to make an autoit script that reads the key hex code. all the scripts i've seen around here seem to involve the following algorithm: ---------------------------------------------------------- If (blah pressed) You pressed (blah) Case <<Look-up-table defining all the keys>> ... ... ------------------------------------------------------------ I wanted one specifically for the multimedia keys,, any ideas ? thanks
jvanegmond Posted July 18, 2006 Posted July 18, 2006 Winamp has a option to customly set Hotkeys, you can also use MEDIA_* there. github.com/jvanegmond
Paulie Posted July 18, 2006 Posted July 18, 2006 (edited) maybe the "_IsPressed" function will help a little...Check the beta helpfile or here Edited July 18, 2006 by Paulie
BPBNA Posted July 18, 2006 Posted July 18, 2006 In Winamp, just go into the preferences, go to Global Hotkeys and enable them. Works perfect with my Logitech G15.
jvanegmond Posted July 18, 2006 Posted July 18, 2006 (edited) Use this, if you can't find them, change the range from the For loop in the function.. : #include <misc.au3> While 1 $p = Pressed() If $p <> 0 Then MsgBox(0, @ScriptName, "Hex value of key pressed : " & $p & @CRLF & "Decimal value of key pressed : " & Dec($p) ) EndIf WEnd Func Pressed() For $x = 400 to 800 If _IsPressed(Hex($x,2)) Then Return Hex($x) EndIf Next Return 0 EndFunc Edited July 18, 2006 by Manadar github.com/jvanegmond
gagan512 Posted July 18, 2006 Author Posted July 18, 2006 In Winamp, just go into the preferences, go to Global Hotkeys and enable them. Works perfect with my Logitech G15.Winamp has a option to customly set Hotkeys, you can also use MEDIA_* there.I dont want this for Winamp alone, want it to be globally available. I'm actually designing the keyboard myself on a USB enabled microcontroller. I have "scan codes" that i program on the chip, but since it a "HID" application, windows does its own thingamagic and converts them to ASCII.I'll look up the IsPressed options, thanks guys
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