Windows – Remapping special keys on a Logitech keyboard

logitech-keyboardremappingwindows 7

I just bought a new keyboard today, and to my surprise it doesn't include "Next/Previous track" keys, although it has other media keys. It also has useless keys like "Home" which brings up the web browser. Or well, it's not actually the "Home" key, it's a special key on the keyboard with a house on it – no idea what it's called. Anyway, so I'd like to remap the "House" key to "Next track".

I've tried three different remapping programs now and none of them seem to be working. I think the real problem is that it's a special key, so it's not included in any keyboard remapping applications.

The keyboard is a Logitech, can't seem to find the exact model though.

Any tips?

Best Answer

  1. Download and install AutoHotkey_L, let it associate with .ahk files
  2. 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
  3. Navigate to the file you saved and double click it
  4. Move the mouse over the "Keyboard Hook" window and press the button you want to map, e.g. Home key
  5. Note the value in the Scan column (e.g. SC132)
  6. Create your own .ahk script
  7. 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.

Related Question