The Misadventures of Quinxy truths, lies, and everything in between!

30Jan/140

Remapping your 101 Key Keyboards (e.g., IBM Model M) to Restore the Windows Key, Menu Key, Media / App Keys on Windows

Thought I'd share this for others using an older 101 key keyboard (like the venerable 1980s/1990s IBM Model M) on Windows.

Using this registry entry I get back my Windows and Menu key:

  • <Shift Lock> is now the <Windows> key
  • <Right Alt> is now the <Menu> key

Just save this code as .reg and double click the file to merge it into the registry, then reboot (or download the file from the link below).

Windows Registry File:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,5c,e0,3a,00,5d,e0,38,e0,00,00,00,00

You can add your own remapping by reading this Microsoft document which describes the format of this registry key and using these scan codes.

I also wrote a little Autohotkey script to make my entirely ignored number pad useful again, with media, volume, and app launching keys.

Here are some basics:

  • <Number Pad 5> is Volume Mute
  • <Number Pad 8> is Volume Up
  • <Number Pad 2> is Volume Down
  • <Number Pad 6> is Next Tab (<Ctrl> + <Tab>)
  • <Number Pad 4> is Previous Tab (<Ctrl> + <Shift> + <Tab>)
  • <Number Pad 1> is Previous Media Track (works in Spotify, Winamp, WMP, etc.)
  • <Number Pad 3> is Next Media Track (works in Spotify, Winamp, WMP, etc.)
  • <Number Pad 0> is Play/Pause Media Track (works in Spotify, WMP, etc.)
  • <Number Pad *> launches Task Manager
  • <Number Pad /> launches default browser with http://google.com

AutoHotkey Script:

SetNumLockState, AlwaysOn
Numpad8::Send {Volume_Up 5} ; increase sound level
Numpad2::Send {Volume_Down 5} ; decrease sound level
Numpad5::Send {Volume_Mute} ; Mute sound
Numpad6::Send {LCtrl down}{Tab}{LCtrl up} ; Next tab (ctrl+tab)
Numpad4::Send {Shift down}{LCtrl down}{Tab}{LCtrl up}{Shift up} ; Previous tab (ctrl+tab)
NumpadMult::Send {Shift down}{LCtrl down}{Esc}{LCtrl up}{Shift up} ; Task manager
NumpadDiv::Run, http://google.com ; Browser to Google
Numpad0::Send {Media_Play_Pause} ; Pause/play media track
Numpad1::Send {Media_Prev} ; Previous media track
Numpad3::Send {Media_Next} ; Next media track

You can just paste that into Autohotkey, compile it into an EXE, or download my compiled exe below.

Download remap_keyboard.zip (374 kb).

Instructions for Download:

Download the file, unzip it, double click the registry file to add the registry entry (reboot to activate the change), and then run the common_remaps.exe to start the number pad remapping.  I added it to my Startup folder in the Windows menu.

(The AutoHotkey script forces Num Lock on so that the hotkeys will work, you can remove that line in the script if you don't need this.)

Users on Deskthority alerted me to the tools Key Tweak and Sharp Keys, tools which lets you do much of the above automagically, through a nice GUI!  That said, the advantage of the AutoHotkey script is that you can script complex and even context-dependent interactions, which only matters if you need or want to do it.)