I want to be able to map the Caps Lock Key to Escape if it is not pressed with any other key and Control if it is. How can I do that on Windows 7?
|
|
You can remap it to Escape with SharpKeys However, I don't know of a realistic way to perform conditional remapping, other than writing a keyboard driver. |
|||
|
|
|
This is not exactly what you want but very close if you can live with some flaws. Here's an AutoHotKey script:
It remaps Caps Lock to Ctrl and sends Escape when you release the key. It took me a while to get used to the Escape key being pressed every time I let go the Caps Lock key. However it's pretty much useless on website textareas because pressing Escape loses the focus on the textarea. I'm looking for a solution to this though. I might go as far as write some sort of driver/keyboard hook in C if needed, haha. Vim-specific annoyances: It makes digraphs impossible to type using the Ctrl-K combination and is generally plain annoying before you get used to it. It works well for me though because I'd do anything to avoid Esc and Ctrl keys as much as possible. |
|||
|
|
|
I use the following AutoHotkey script for this, adapted from one I found on the Vim Tips Wiki. The impementation is a bit hacky, but it "works for me." (And unlike the other answers on the page, it fully solves the issue without caveats.) The original coder noted:
|
||||
|
|
|
The remapkey.exe program included in the Windows Server 2003 Resource Kit Tools mentioned in this article works nicely in Windows 7. |
|||
|