Like caps2esc, but for Chrome OS.
I started with dstarikov/esc2ctrl which was cloned from mogenson/esc2ctrl. My version is much simpler because I realized I only needed to watch for taps on the Control key. I had problems with the upstream versions hanging the control key in the down position. This one can't do that.
It is my factual opinion that the best keyboard mapping is to have the Search key (Caps on a normal keyboard) send an Esc key event when pressed by itself and a Ctrl key event when used a modifier with another key. Try this out when using Vim or Tmux and thank me later.
The caps2esc
utility for Linux does this perfectly. ctrl2esc
is my attempt
to mimic this behavior on Chrome OS. It creates an Esc key event
when the Ctrl key is pressed by itself and otherwise leaves things
alone. This works best when mapping the 🔍 key and Caps
to Ctrl in the Chrome OS keyboard settings.
- Set Caps Lock and Search to Control in Settings->Device->Keyboard
- Enable the Developer mode switch in the top right of
chrome://extensions
- Press the Load unpacked button and select the
ctrl2esc
folder - Press Input method -> Manage input methods and select
ctrl2esc
inchrome://settings/languages
- Enable Show input options in the shelf
- Select
EN ctrl2exc
in the Chrome OS shelf, near the notifications
The Chrome input method
editor system only provides
a valid context for text field entries. ctrl2esc
will work for apps that are
text fields like the Secure
Shell
app and the hterm based Crostini Terminal app.