Jump to content
Sign in to follow this  
James

Using multimedia keys

Recommended Posts

James

Hey,

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?

Thanks,

James

Share this post


Link to post
Share on other sites
DW1

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

#include <misc.au3>
While 1
    sleep(10)
    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 & ")")
        EndIf
    Next
WEnd

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
therks

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  

×