If you're a Windows user who relies on Vim and prefers to swap the functionality of the Escape key with Caps Lock and, for some reason sometimes you need the Caps Lock in it's right position, this script provides a convenient solution.
I Know that you thought "Why he just not use Windows PowerToys?". And to be honest I was using. But the problem is that it doesn't provide a convenient way to swap keys back and I needed the CAPSLOCK in its right position to do "unit control" on Dota 2 ... So this is the main reason that I made this little script
You should probably use the ahk
version. I did the Rust version because yes and because I wanted to experiment do a program that I would deal with OS stuff, so I implemented in Rust. The final version was a bit bigger than I though... Well, nothing is perfect
There has a C version, is lower in size then the other two versions and do the same thing but better, it sends a hardware keystroke and it uses icons istead of those popups
To activate the script, simply press WIN
+ ALT
+ C
. This will toggle the functionality between the normal mode and the swapped mode.
Pressing these buttons will display a 3seconds pop-up show a icon to inform if its in swapped or normal mode
In the normal mode, the keys function as usual. When toggled to the swapped mode, the Escape key acts as Caps Lock, and vice versa.
To ensure the script runs automatically every time you start your computer:
- Press
WIN
+R
to open the Run dialog. - Type
shell:startup
and press Enter. This will open the Windows Startup folder. - Move the
.exe
file of the script into this folder. - Restart your system to apply the changes.
This will enable the script to run in the background upon system startup, providing seamless functionality without manual activation.
If you encounter any issues or have suggestions for improvement, feel free to reach out or submit a pull request. Your feedback is invaluable in enhancing the usability and effectiveness of this script for the Vim community on Windows.
1. If you are playing, or in a full screen software, the pop-up will minimize the software ¯_(ツ)_/¯