This set of 2 scripts and Micha's DLL file (thanks again Micha! couldn't have done it otherwise) allow you to replace the default actions of those media keys on some keyboards (like Play, Pause, Volume, etc) by defining your own actions.
This could probably also be used for other USB devices with very few changes.
I've included an instructions text file and examples/info at the top of each script file. Please take a look at them or else you probably won't get very far
As an example of what it can do: I've currently remapped the volume wheel on my keyboard to adjust the master volume and display a simple On Screen Display (OSD) of the action and the volume level.
Download link (zip file):
https://ahknet.autoh... ... 20Keys.zip
Micha's original script thread:
http://www.autohotke...opic.php?t=6367
It would be helpful to others if anyone using the script could report back their keyboard make/model and if they had to change the EditUsage and EditUsagePage values from the default (all described in the zip file).
p.s. Micha, I hope you don't mind me including your DLL file in the zip file?
Keyboard Media Keys (for USB HID devices!)
Started by
evl
, Dec 30 2005 04:13 AM
43 replies to this topic
#1
-
Posted 30 December 2005 - 04:13 AM
Nice post. This will be a great resource to those who want to customize their keyboard in ways the manufacturer doesn't support.
#2
-
Posted 30 December 2005 - 02:04 PM
Hi evl,
great job!
Feel free to use the dll and script in any way you desire!
Nice to see my little work be useful.
I have to mention that there could be a problem (somewhere).
I use a remote control. When I record the same key a lot of times the rawdata changes somehow.
When recording the key it shows the value "53570000". After a few times using it, the value changes to 53570053.
I guess there's something wrong with the conversion-routine or my dll. If I find something, I will post it.
Ciao
Micha
great job!
Feel free to use the dll and script in any way you desire!
Nice to see my little work be useful.
I have to mention that there could be a problem (somewhere).
I use a remote control. When I record the same key a lot of times the rawdata changes somehow.
When recording the key it shows the value "53570000". After a few times using it, the value changes to 53570053.
I guess there's something wrong with the conversion-routine or my dll. If I find something, I will post it.
Ciao
Micha
#3
-
Posted 30 December 2005 - 09:35 PM
@Micha:
Thanks for all the work and making the dll available to use
I haven't really seen any issues yet, but I've not been using it long enough to notice perhaps.
Thanks for all the work and making the dll available to use
I haven't really seen any issues yet, but I've not been using it long enough to notice perhaps.
#4
-
Posted 30 December 2005 - 11:39 PM
Wow! This is really awesome!
I tried it with my Logitech Cordless Keyboard (I wonder how it is named...) and it was super easy to set up and it detects every single of my 30+ Media Keys apart from the second enter key I got.
I'm using this now as a sleek replacement for the clunky Logitech driver.
I just wonder why noone answered in this thread since over a year? Is there another, more supported version out?
Thanks a lot!
I tried it with my Logitech Cordless Keyboard (I wonder how it is named...) and it was super easy to set up and it detects every single of my 30+ Media Keys apart from the second enter key I got.
I'm using this now as a sleek replacement for the clunky Logitech driver.
I just wonder why noone answered in this thread since over a year? Is there another, more supported version out?
Thanks a lot!
#5
-
Posted 07 May 2007 - 05:50 PM
hi, i use and i liked very much
I just want put more than one line of code
but your program just accept one line
It is possible to put more than one code in the same line?
like change this
IfWinNotActive, ahk_class BSPlayer
WinActivate, ahk_class BSPlayer
IfWinActive, ahk_class BSPlayer
Send, {SPACE}
for something in one line only
Because if i change the in the file "Keyboard Media Keys Actions" and put several lines ( and work fine)
When i try to run "Keyboard Media Keys - detect keys" and add up a key
I have to go back to "Keyboard Media Keys Actions" and change again
tks very much and congratz for the excellent script
I just want put more than one line of code
but your program just accept one line
It is possible to put more than one code in the same line?
like change this
IfWinNotActive, ahk_class BSPlayer
WinActivate, ahk_class BSPlayer
IfWinActive, ahk_class BSPlayer
Send, {SPACE}
for something in one line only
Because if i change the in the file "Keyboard Media Keys Actions" and put several lines ( and work fine)
When i try to run "Keyboard Media Keys - detect keys" and add up a key
I have to go back to "Keyboard Media Keys Actions" and change again
tks very much and congratz for the excellent script
#6
-
Posted 23 October 2007 - 06:39 PM
I made it only use one line of code to keep things simple. You can change it manually as you did. One solution is to have the key (the single line of code) run another script which contains the longer code you want to run.
#7
-
Posted 25 October 2007 - 04:35 AM
evl, thanks for the scripts. It looks like it will be useful. I have a Logitech Cordless Wave Desktop and haven't been able to map most of the keys using the conventional methods but they all seem to be detectable using this method.
One interesting key is called "Fn" which is used to activate special functions on the F1-F12 and Print Screen and Pause keys. I actually expected that this button wouldn't send any data itself, but it does. Your script detects the Fn key as soon as it is pressed. I'm wondering if there's a different code sent when the Fn key is pressed in combination with one of its target buttons or if it just sends the one code and the combination is interpreted by the Logitech driver?
Also, the Fn key is between the right Alt and Ctrl. I'd much rather it be the RWin key which I used extensively on my last keyboard as a modifier for other hotkeys. In your script, the action defined for the Fn key is executed as soon as the Fn key is pressed. Is there any way I could remap the Fn to Rwin? This would require, I think, detecting both the key down and key up events so that Rwin could be virtually pushed down then virtually released at the appropriate times.
Thanks!
One interesting key is called "Fn" which is used to activate special functions on the F1-F12 and Print Screen and Pause keys. I actually expected that this button wouldn't send any data itself, but it does. Your script detects the Fn key as soon as it is pressed. I'm wondering if there's a different code sent when the Fn key is pressed in combination with one of its target buttons or if it just sends the one code and the combination is interpreted by the Logitech driver?
Also, the Fn key is between the right Alt and Ctrl. I'd much rather it be the RWin key which I used extensively on my last keyboard as a modifier for other hotkeys. In your script, the action defined for the Fn key is executed as soon as the Fn key is pressed. Is there any way I could remap the Fn to Rwin? This would require, I think, detecting both the key down and key up events so that Rwin could be virtually pushed down then virtually released at the appropriate times.
Thanks!
#8
-
Posted 23 January 2008 - 01:23 AM
Hi guys, thanks a lot both for AutoHotKey and for Keyboard Media Keys library.
If was trying to force my upper buttons of split Microsoft natural keyboard to do the activating of window based on its title.
There were two problems:
1) even if I uninstalled keyboard drivers, it was starting homepage when I hit Home special button
2) keys labeled 1 to 5 were detected with same key code in Keyboard media keys(0000004800000049)
So finally I achieved what I wanted by using original Microsoft drivers and assigning AHK scripts to the keys - read "Create shortcut to activate window by title" at http://jetensky.net/... ... -by-title/
If was trying to force my upper buttons of split Microsoft natural keyboard to do the activating of window based on its title.
There were two problems:
1) even if I uninstalled keyboard drivers, it was starting homepage when I hit Home special button
2) keys labeled 1 to 5 were detected with same key code in Keyboard media keys(0000004800000049)
So finally I achieved what I wanted by using original Microsoft drivers and assigning AHK scripts to the keys - read "Create shortcut to activate window by title" at http://jetensky.net/... ... -by-title/
#9
-
Posted 01 February 2008 - 10:04 AM
Goldship Arch Slim Keyboard Office: Fn cannot be remapped, not a real key
Multimedia Keys Map:
http://docs.google.c...wmw_116tj5svdvr
Multimedia Keys Map:
http://docs.google.c...wmw_116tj5svdvr
#10
-
Posted 05 February 2008 - 02:02 PM
I used this script on my mac wireless bluetooth keyboard which I use on my pc. It works great for the eject and fn button.
However I wonder if it is also possible to remap the buttons instead to run a function. For example I would like my eject button to be delete.
Thanks
However I wonder if it is also possible to remap the buttons instead to run a function. For example I would like my eject button to be delete.
Thanks
#11
-
Posted 15 February 2008 - 09:11 AM
ok sorry this is easy of course:
4854: ; eject -> delete
send {delete}
Return
4854: ; eject -> delete
send {delete}
Return
#12
-
Posted 15 February 2008 - 09:36 AM
Hi,
Thank you for these scripts. I have a dell multimedia keyboard that has worked on every computer for years, except for this HP laptop that I use at work. So I used these scripts to program the volume and the media keys.
I'm wondering, I've seen some scripts that have a Bar Graph type of display for the Volume, but no matter how I tried to add them to Keyboard Media Keys Actions.ahk I kept on getting errors.
Any thoughts on how this can be achieved?
Best Regards
Thank you for these scripts. I have a dell multimedia keyboard that has worked on every computer for years, except for this HP laptop that I use at work. So I used these scripts to program the volume and the media keys.
I'm wondering, I've seen some scripts that have a Bar Graph type of display for the Volume, but no matter how I tried to add them to Keyboard Media Keys Actions.ahk I kept on getting errors.
Any thoughts on how this can be achieved?
Best Regards
#13
-
Posted 16 June 2008 - 09:48 PM
show how you are adding the code.
If you want, start a new topic in Ask for help, (with a link to this topic) and more people will see your question.
If you want, start a new topic in Ask for help, (with a link to this topic) and more people will see your question.
#14
-
Posted 17 June 2008 - 04:57 PM
Hi,
I have been trying to use the tips in this thread to get the Eject button on my new compact keyboard (menat for a MAC, but I want to use it with my Shuttle PC) to do something useful. "Copy" would be useful, i.e. "send {LControl}{c}.
I cannot get it to work, though. I have used the "Keyboard Media Keys - detect keys" script, and it detects the Eject key with key code 53550048000000 (seems a bit long, can that be right?). I ran the "Keyboard Media Keys" script and it created "Keyboard Media Keys Actions", but when I run that, the Eject key is still ignored.
What could I be doing wrong, or failing to do right?
I have been trying to use the tips in this thread to get the Eject button on my new compact keyboard (menat for a MAC, but I want to use it with my Shuttle PC) to do something useful. "Copy" would be useful, i.e. "send {LControl}{c}.
I cannot get it to work, though. I have used the "Keyboard Media Keys - detect keys" script, and it detects the Eject key with key code 53550048000000 (seems a bit long, can that be right?). I ran the "Keyboard Media Keys" script and it created "Keyboard Media Keys Actions", but when I run that, the Eject key is still ignored.
What could I be doing wrong, or failing to do right?
#15
-
Posted 21 August 2008 - 07:50 PM