Actually I found this:
Keyboard Remapping: CAPSLOCK to Ctrl and Beyond - Scancode Map, registry, keyboard, WM_APPCOMMAND, Flip3D, 3dFlip, Win7, Vista, dwmApi
With a registry hack you can reassign the Caps Lock key to, say, VK_BROWSER_HOME which has the scancode "E0 32". This means the binary key
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map" should contain this:
Code:
00 00 00 00 00 00 00 00 02 00 00 00 E0 32 3A 00 00 00 00 00
Now, it so happens that VK_BROWSER_HOME has a reconfigurable action (APPCOMMAND_BROWSER_HOME) and is AppKey 7. This should mean that if we rename the key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\7\Association" to
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\7\ShellExecute" and give it the following value:
Code:
"start http://www.google.com"
we should get a nice new tab of Google each time we press caps lock.
At least that's the theory as I have yet to reboot and try it.
Assuming this does work, we can eventually replace that start command with the path to my script which also keeps track of the current new mail status.
To summarize:
- Remap Caps Lock to VK_BROWSER_HOME
- Replace the default action with the path to my script
- Now each time you press the Caps Lock key the script will redirect you to either Google or GMail
- Set up some sort of visual hint if you have new mail
Now lets pretend I knew this more than 10 minutes ago
Edit:
I'd like to avoid closed source tools to accomplish this (it's in my nature, I'm a Linux guy after all

) even though that LED stuff looks similar to the IOCTL calls with a 3-bit bitmask for controlling the LEDs.
Now we know it's possible and we just have to figure out how AHK does it.