Jump to content

Trying to get hotkeys to work


ahab
 Share

Recommended Posts

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
Link to comment
Share on other sites

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')

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

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())
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...