- Download and install AutoHotkey_L, let it associate with .ahk files
- Grab the script called "Keyboard Hook - 90L" from Scriptlet to find Scancode of a Key and save it somewhere, e.g. My Documents/keys.ahk
- Navigate to the file you saved and double click it
- Move the mouse over the "Keyboard Hook" window and press the button you want to map, e.g. Home key
- Note the value in the Scan column (e.g. SC132)
- Create your own .ahk script
- Add the .ahk script to your Startup folder
Your script should contain e.g.
SC132::Send {Media_Next}
Or, you could map Windows+Left to previous track and Windows+Right to next track with this AutoHotkey script:
#Left::Send {Media_Prev}
#Right::Send {Media_Next}
Or this way works even if the window is hidden or minimized:
#Left::SendMessage, 0x319, 0, 0xC0000, , iTunes
#Right::SendMessage, 0x319, 0, 0xB0000, , iTunes
but you have to Google to find out the values like 0xC0000.
Some other useful shortcuts:
#Up::Send {Volume_Up}
;#Up::SoundSetWaveVolume, +20
#Down::Send {Volume_Down}
;#Down::SoundSetWaveVolume, -20
;#NumpadIns::Send {Media_Play_Pause}
;#Numpad0::Send {Media_Play_Pause}
#Ins::SendMessage, 0x319, 0, 0xE0000, , iTunes
#Del::Send {Volume_Mute}
#NumpadIns::SendMessage, 0x319, 0, 0xE0000, , iTunes
#Numpad0::SendMessage, 0x319, 0, 0xE0000, , iTunes
; works on Vista without IntelliType
#NumpadDot::Send {Volume_Mute}
#NumpadDel::Send {Volume_Mute}
; works on Vista with IntelliType when AutoHotKey.exe is in Windows XP mode
;#NumpadDot::SoundSet, +1, , mute
;#NumpadDel::SoundSet, +1, , mute
See the AutoHotkey docs for more details.
Best Answer
The best tool for the job is Microsoft's own
remapkey.exe
, available as part of the Windows Resource Kit. (That link is for Windows 2003; I've used it successfully over the years on many versions of Windows, including Windows 7; have not tested Windows 8).remapkey.exe
will write the mapping directly into the registry, I believe, and does not require a running process. You simply drag from actual key to desired key, and save.