Maybe not everyone knows this, but instead of pressing ESC in vim, which is kind of far, you can do Ctrl+[, it will send the same signal to vim.
Looking at the ASCII table (man 7 ascii) you’ll instantly know why, control is interpreted in terminals as nullifying the 6th and 7th bit:
033 27 1B ESC (escape) 133 91 5B [
This is also the reason why ESC often shows as ^[.
I have caps lock mapped to ctrl, so ESC is just a small movement away for my little fingers. Not sure if that helps RSI avoidance, but it’s a bit less stretching around.
Even better, bind caps lock to ESC (when tapped) and CTRL (when chorded) using e.g. caps2esc on Linux or AutoHotKey on Windows. This has dramatically reduced stress I was experiencing in my left forearm, as my wrists sit at a much more natural angle.
I’m surprised that the three pedals send characters only when pressed. From the description, I would’ve guess the author was going to have it also send ESC when released to behave more like a clutch.
Hi, migurski. It might have been misconstrued by the single function definition that I included, but each pedal does indeed create an “Esc” keypress on release. It’s much clearer in the full “vim-clutch.py” script in the GitHub repo if you’re interested: https://github.com/l00sed/vim-clutch.git
I think I should have put that in a more pronounced place.
I am not an electrical engineer, but shouldn’t there be some current-limiting resistors in front of RPi’s GPIO pins? Also, those pins operate on 3.3V and are not 5V tolerant.1 Hardware debounce might be relevant as well.2
Input pins are in high-impedance state so normally they don’t need current limiting resistors. However, current limiting resistors on inputs might be used as a (non-recommended) hack to make non-5V-tolerant pins work at 5V signal: usually the problem with such pins is in ESD protection that sinks 5V to 3.3V power supply line and series resistor at input pin limits current of this. Probably, here it’s simpler to just power the pedal with 3.3V.
Also, probably the pedal itself contains necessary pull-up or pull-down resistors as it has both power and ground wires. But Button abstraction from that Python library turns on builtin pullup on its pin by default. It’s unclear how the whole system works. BTW, that library has software debounce, but it isn’t enabled by default.
Hey sorry about that, I haven’t had time to do testing. If you’re interested in the code, you should probably be able to access https://github.com/l00sed/vim-clutch.git until I get that sorted out.
Maybe not everyone knows this, but instead of pressing ESC in vim, which is kind of far, you can do
Ctrl+[
, it will send the same signal to vim.Looking at the ASCII table (
man 7 ascii
) you’ll instantly know why, control is interpreted in terminals as nullifying the 6th and 7th bit:This is also the reason why ESC often shows as
^[
.Isn’t that even worse from the RSI-avoidance point of view?
I have caps lock mapped to ctrl, so ESC is just a small movement away for my little fingers. Not sure if that helps RSI avoidance, but it’s a bit less stretching around.
That’s very interesting, I did not know that.
Or use something like xcape and turn Ctrl into ESC.
Even better, bind caps lock to ESC (when tapped) and CTRL (when chorded) using e.g. caps2esc on Linux or AutoHotKey on Windows. This has dramatically reduced stress I was experiencing in my left forearm, as my wrists sit at a much more natural angle.
Switching caps and esc is also really good tho! How often do you need to caps, really?
I’m surprised that the three pedals send characters only when pressed. From the description, I would’ve guess the author was going to have it also send ESC when released to behave more like a clutch.
Hi, migurski. It might have been misconstrued by the single function definition that I included, but each pedal does indeed create an “Esc” keypress on release. It’s much clearer in the full “vim-clutch.py” script in the GitHub repo if you’re interested: https://github.com/l00sed/vim-clutch.git I think I should have put that in a more pronounced place.
Isn’t there an Emacs clutch somewhere too? Honestly that makes more sense to me, given the RSI complaints.
Using pedals for Emacs is not really that uncommon, e.g..
That’s what I thought! I thought I’d read or heard somehting before about an emacs pedal.
(BTW, if you tried to add a link, it didn’t come thru for me)
I am not an electrical engineer, but shouldn’t there be some current-limiting resistors in front of RPi’s GPIO pins? Also, those pins operate on 3.3V and are not 5V tolerant.1 Hardware debounce might be relevant as well.2
Input pins are in high-impedance state so normally they don’t need current limiting resistors. However, current limiting resistors on inputs might be used as a (non-recommended) hack to make non-5V-tolerant pins work at 5V signal: usually the problem with such pins is in ESD protection that sinks 5V to 3.3V power supply line and series resistor at input pin limits current of this. Probably, here it’s simpler to just power the pedal with 3.3V.
Also, probably the pedal itself contains necessary pull-up or pull-down resistors as it has both power and ground wires. But
Button
abstraction from that Python library turns on builtin pullup on its pin by default. It’s unclear how the whole system works. BTW, that library has software debounce, but it isn’t enabled by default.Thanks for details.
The site design went haywire about half way down when reading on my iPhone, and ate the left hand few columns of characters.
Hey sorry about that, I haven’t had time to do testing. If you’re interested in the code, you should probably be able to access https://github.com/l00sed/vim-clutch.git until I get that sorted out.