After 10 years, my old Windows-unaware keyboard finally stopped working reliably, so I had to buy a new keyboard (Genius KB-16e, for those who are curious). Well, the first think I did was refrain from using the supplied driver (because I am sure AutoHotKey will do a far better job), the second was starting to write a script that would disable Windows and Menu keys. I disabled Menu easily enough:
Code:
AppsKey:: return
but I am at a loss as to how to disable the Windows key. The problem is that while I want to disable the key when pressed alone (Windows-down, Windows-up ----> Start menu is displayed), I want to keep the key as a modifier for shortcuts (Windows + L ----> Lock Workstation). At first I thought I would simply write it as a hotstring, but apparently that's not possible. So I decided I would write three handlers:
Code:
LWin::
WindowsKeyDown = 1
$LWin Up::
If WindowsKeyDown <> 1
Send, {LWIN UP}
~anykey::
WindowsKeyDown = 0
But there I found another problem: How do I address "anykey" in a hotkey handler?