Sat, 22 Oct 2016

Swapping caps lock and esc keys


Keywords: Windows capslock escape control caps2esc

On almost all modern keybaords the useless capslock key is right where something useful should be. Initially the control key would have been there. On some keyboards the escape key was there and this influenced the design of vi.

The escape key and the control key can actually be combined such that if you press the key on its own then you get an escape, and if you press it with something else you get the control key. Then you need to put this key where the capslock key is now and move the capslock to the escapse key.

On Windows the Interception library can be used to do this. The steps for Windows 7 are:

- Download and install the Windows Driver Kit from https://www.microsoft.com/en-us/download/details.aspx?id=11800
- Set WDK to C:/WinDDK/7600.16385.1 (or wherever it was installed)
- git clone https://github.com/oblitum/Interception
- run buildit.cmd in the library directory
- run buildit.cmd in the samples/caps2esc directory
- copy caps2esc/objfre_wxp_x86/i386/caps2esc.exe and library/objfre_wxp_x86/i386/interception.dll into a new directory (I use C:/caps2esc)
- add a shortcut to c:/caps2esc/caps2esc.exe to the startup directory

For linux use caps2esc, but this won't work well inside a VM.

I suppose you could download the version I compiled for Windows 7. I have no idea whether it will work for anything else, amd you will need to make sure you are within the licence.

For Windows 10 tihngs are somewhat simpler:

- download Interception: https://github.com/oblitum/interception/releases/latest
- as administrator, run install-interception /install
- add a shortcut to caps2esc.exe to the startup directory
  - Windows-R / shell:startup / add link

[/software/windows] permanent link




September 2017
Sun Mon Tue Wed Thu Fri Sat