How to disable Windows Key on gaming PC
I like gaming, especially real time strategies like Starcraft 2 and Warcraft III: TFT. Today I was playing Warcraft III online and accidentally pressed that damn Windows Key in middle of the battle. I was looking at my desktop while my army was dying from the night elf forces without my help. It took some time for me to switch back to the game, but in Warcraft III each second matters. Unfortunately in this game (like in many other games) there is no option to disable Windows Key through the menu.
When I was 12-year-old boy I solved this problem by pulling out Windows Key itself from the keyboard. That was good enough.
That solution would not work for me now. As soon as I started using the Run menu, Command line and the hotkeys I needed this button to be present. Recently I found two ways to solve this. I found the registry method to be the easiest one but you can decide for yourself.
Method 1 - Keyboard Hook Tool
I am sure there must be many applications that allow you to disable certain keys. I though decided to write it myself so I'll be in control of what's happening under the hood. Also I don't trust random apps from the Internet that ask me for the admin rights. This always was a hard decision for me.
I called this app DieWinKey and spent less that an hour to get it done. Thanks to the useful article on MSDN blog by Stephen Toub on how to implement low level keyboard hooks in .NET.
The main goal was to make the app small and simple. It is a .NET 2.0 application that runs in system tray and disables both Left and Right windows keys. To shut it down you just right click and chose Exit. You can set it to run on windows start up (manually) or just execute each time before you run your favorite game.
Method 2 - Windows Registry
Personally I love this one, because I have a dedicated gaming PC and don't use Windows key on it that often. So I've created a *.reg file that does all the things.
Unfortunately you have to restart your PC after running the script to make things work.
If you don't trust the script or want to do all the things manually here is the steps:
1. Go to registry editor. Run -> type regedit -> click OK.
2. Locate the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout.
3. From Edit menu or context menu chose New -> Binary Value.
4. Name it Scancode Map.
5. Type manually this sequence in value data field: 00000000000000000300000000005BE000005CE000000000.
That's it. Your can forget about your Windows Key pressings while playing. Good luck on the battlefield!