Jump to content
Sign in to follow this  

Using multimedia keys

Recommended Posts



I have just been searching for a way of using the extra keys on my keyboard. A small list of them:

  • Play Sound
  • Stop Sound
  • Next Track
  • Previous Track
  • Vol Up
  • Vol Down
  • Mute
  • Run Calculator
  • Favourites
  • Run Browser
I did a search for multimedia keyboard buttons etc but no luck. I found a Developer topic about Keyboard hooking, but it contained no script.

Any ideas?



Share this post

Link to post
Share on other sites

A couple more things, first off this makes it easy to find the values:

#include <misc.au3>
While 1
    For $i = 0 to 255
        if (_IsPressed(Hex($i))) Then
            MsgBox(0, "", "You pressed the: " & Chr($i) & " Key!" & @CRLF & "Which would be polled with: _Ispressed(" & $i & ")")

Second thing is, on my PC (i was making a script similar to yours) I ran into a problem with my keyboard calling default applications/actions for those media buttons (some of them anyway). To get around the defaults, I had to download the proper driver/soft for my keyboard, so that I could set the keys to do nothing... or (what I ended up doing)set a couple of them to just run a script (exe) you wrote.

Good luck :P

Share this post

Link to post
Share on other sites

HotKeySet('{MEDIA_PLAY_PAUSE}', '_HotKey') ; Play Sound
HotKeySet('{MEDIA_STOP}', '_HotKey') ; Stop Sound
HotKeySet('{MEDIA_NEXT}', '_HotKey') ; Next Track
HotKeySet('{MEDIA_PREV}', '_HotKey') ; Previous Track
HotKeySet('{VOLUME_UP}', '_HotKey') ; Vol Up
HotKeySet('{VOLUME_DOWN}', '_HotKey') ; Vol Down
HotKeySet('{VOLUME_MUTE}', '_HotKey') ; Mute
HotKeySet('{LAUNCH_APP1}', '_HotKey') ; Run Calculator (might be APP2)
HotKeySet('{BROWSER_FAVORITES}', '_HotKey') ; Favourites
HotKeySet('{BROWSER_HOME}', '_HotKey') ; Run Browser

Not all guaranteed to work.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.