The context menu key looks like this:
It’s normally on the same row as the space bar, usually to the right of it:
This is how a Lenovo W530 (and Carbon X1, and probably many other current-generation models) keyboard looks:
Notice anything missing?
Now, I could hit Shift+F10 any time I need the context menu (I’m sure you know that, right?) but I’m used to having the key there there. And, besides, I don’t use PrtSc all that much.
Like all things interesting, the secret is in the registry. Microsoft is kind enough to provide a guide, Scan Code Mapper for Windows. It’s a little dated (a dozen years) but things like keyboard codes don’t really change all that much.
Nor the difficulty in getting the registry entry just right. It’s an unforgiving beast.
Enter SharpKeys. It’s pretty straightforward to use: you map a key by telling the program that you’re going to hit the key you want to map, do that, then tell the program you’re going to hit the key you want the first key to send out as the keycode. Here:
That’s me hitting the PrtSc key. Now, to hit the … uh. We are experiencing technical difficulties. That’s actually the keycode for the context menu key.
Here’s a confession: this is why I’m writing this blog entry. It’s cleverly caching the keycode for the context menu so I know where to go when I reformat my machine. (Which I know I’ll do sometime in the next 6 months.)
Without further ado, here’s the keycode I want my PrtSc to send:
Special: Application (E0_5D).
Now reboot. Yep, you need to reboot for the magic to work. Now you see why I need this post: doing this by trial and error will drive me mad.
Now, to be fair, Microsoft has it’s own tool: Microsoft Keyboard Layout Creator 1.4. It’s only half a dozen years old. Again, keyboard codes don’t change much. I’ve just been using SharpKeys since around 2005-2006, hence my writing about it instead. Back then it was the whole "the Control key belongs on TOP of the Shift key" fight. Ah, happy days.
And, if you trust random regkey one-liners you find out in the web, here’s something you can copy-and-paste into a .REG file and reg.exe import:
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,02,00,00,00,5d,e0,37,e0,00,00,00,00