Remapping special keys on a Logitech keyboard

10,948
  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.

Share:
10,948

Related videos on Youtube

thedude
Author by

thedude

Updated on September 17, 2022

Comments

  • thedude
    thedude over 1 year

    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?

    • uxout
      uxout over 13 years
      Have you tried in the SetPoint software? (Also the exact model should be written on a label on the bottom.)
    • thedude
      thedude over 13 years
      I just installed it, and it doesn't show any settings at all for the keyboard. I've got a logitech mouse aswell, and it only shows settings for that. :/
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 13 years
      Under what operating system?
    • thedude
      thedude over 13 years
      Windows 7 Professional, 86-bit
    • Dennis Williamson
      Dennis Williamson over 13 years
      @Gilles: If not named, it's always the "default". Wow, I haven't seen anything that was 86-bit! I bet that really hums!
    • thedude
      thedude over 13 years
      @Dennis, i didn't mention i was on Windows 7. Don't make a fool out of yourself.
    • uxout
      uxout over 13 years
      @Dennis, confusing x86 for 86-bit is not THAT unusual. You could be a little nicer in pointing out that 'x86' is the name of the processor instruction set, and means it's a 32-bit operating system.
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 13 years
      @thedude: You should put a tag for your OS (either specific like windows-7 or generic like windows), not just because the OS is vital information to answer your question, but also because some people filter on tags so you're missing out on potential answerers.
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 13 years
      @Dennis: Ok, noted. On my machine, “default” in the boot menu is Debian stable, so that's what I'll assume. Seriously, I hope that by leaving comments on poorly informed posts I'll encourage people to post more information (an uphill battle, I know).
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 13 years
      @Shinrai: On the other hand, when people mention the word size, it's usually 64. So the mystery is still open! (But I think this bit of info is useless here.)
    • uxout
      uxout over 13 years
      @Gilles - Agreed that it's meaningless. I was objecting to the tone - being condescending is not the way to make new users want to stick around.
    • thedude
      thedude over 13 years
      Running OT here guys, can any of you provide me with something useful?
  • thedude
    thedude over 13 years
    That was what i had in mind when i first wanted to remap the key, thanks. The "keyboard-hook" script doesn't give me the correct code though. All the "special keys" on the keyboard shows as "SC000". Any idea on how to find out the actual code of it?
  • Nethan
    Nethan over 13 years
    It might actually help to remove all Logitech software. Of course, if you're using a Logitech mouse, you might lose any special functionality.