Jump to content
Sign in to follow this  
ahab

Trying to get hotkeys to work

Recommended Posts

ahab

So I have some off brand keyboard that I can no longer find drivers for. It has the semi-standard back, forward, vol+ vol- and so forth keys on it. Only a few don't work.

Running AutoHotkey and pressing these keys gives me the value of "176" for next track.. I'm not quite sure of what to make of this.

HotkeySet("176","Media_Next")

Func Media_Next()
    Send("{MEDIA_NEXT}")
EndFunc

While 1
   Sleep(250)
Wend
Does nothing for me. AutoHotkey can understand it, but I'd rather just stick this in with all my other hotkeys that are written in Autoit.

I assume 176 is a hex value for the key. What would I need to set the hotkey as or how can I detect the hotkey?

Edited by ahab

Share this post


Link to post
Share on other sites
therks

Actually, SENDing {MEDIA_NEXT} is just like pressing the key on the keyboard, it's sending the same message, you'll get the same result.

You can even use it as a hotkey, I have similar keys on my keyboard, but have them setup to do different things.

For example, the "Play/Pause Music" key on my keyboard is hotkeyed to open Winamp.

ie:

HotKeySet('{MEDIA_PLAY_PAUSE}', '_OpenWinamp')

Share this post


Link to post
Share on other sites
ahab

I have the key there... but I don't know what to call it in AutoIt.

HotKeySet('{whatgoeshere?}',"DoWhatever")

Any way to capture what keys are being pressed in the scheme that AutoIt names them?

Edited by ahab

Share this post


Link to post
Share on other sites
therks

Have a look at the send key list in the help file. If one of the keys mentioned sounds like it might match your key, try it. If you can't find any key at all that looks like it matches, then it may not be available. For instance, on my keyboard, I have a "Power Off" key, it shuts the computer down. I wish I could capture that and just tell it to do nothing as it doesn't even prompt me. Quite annoying.

Share this post


Link to post
Share on other sites
ahab

TweakUI does not see the key at all.

HotKeySet('{MEDIA_NEXT}',"{MEDIA_NEXT}")

doesn't work.

HotKeySet('{whatgoeshere?}',"{MEDIA_NEXT}") Autohotkey detects the key as 176. What would AutoIt see it as?

Edited by ahab

Share this post


Link to post
Share on other sites
MSLx Fanboy

The second argument isn't a key, its a function. Try this:

HotKeySet('{MEDIA_NEXT}','TestFunc')

Func TestFunc()
   MsgBox(0, "test", "HotKeySet was Successful!")
   Exit
EndFunc

While 1
   Sleep(15)
WEnd

Edit: forgot bbtag

Edited by MSLx Fanboy

Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×