
Vim Clutch – A hardware pedal for improved text editing (2012) - mfrw
https://github.com/alevchuk/vim-clutch
======
powvans
I love seeing this. I worked in the university computing department in college
and this sort of thing wasn't an uncommon sight under the desks. People also
had all manner of exotic keyboards.

The most elite setup, as I recall, was the Kinesis Advantage combined with
pedals. The keys on the Kinesis are recessed in these sort of cups that your
fingers rest above. The idea is that this reduces the distance that your
fingers travel moving between rows. I could never get the hang of typing on
one of them, but people swore by them. Adding the pedals for shift/ctrl/esc
was supposed to further reduce the need to stretch your fingers and get them
into awkward positions. People also swore it made them faster and of course it
looked and _sounded_ super cool.

~~~
czeidler
Once you mastered the Kinesis Advantage you don't want to go back. Your hands
move way less on the Kinesis than on a normal keyboard. Maybe this is also the
reason why I always found the use of ESC in vim an odd choice, i.e. you have
to move your hand to reach the ESC key. Moreover, the Kinesis has the arrow
keys below the "c" "v" "m" "," keys so you can navigate without moving your
hands, this is similar to vim but without the annoying mode switches.

~~~
adrianratnapala
> without the annoying mode switches.

Hmm, I've used Vi and other editors long enough that I find it annoying that
most editors enter text when in normal mode.

------
trishume
I use a setup that's similar in spirit. My custom keyboard has palm keys (kind
of like the [https://shop.keyboard.io/](https://shop.keyboard.io/)), which I
have mapped to control and shift (on a mac). I have a Sublime Text keymap file
that has a bunch of vim-like bindings under control, so basically it is like
vim but the state of my palms is the editing state, holding one down is
movement, both is selection. It's really nice.

You can see the keymap here:
[https://github.com/trishume/SublimeTect/blob/master/Default%...](https://github.com/trishume/SublimeTect/blob/master/Default%20\(OSX\).sublime-
keymap)

~~~
alschwalm
The keyboardio is the only keyboard I know of that has the palm keys, but I've
been interested in buying or making a keyboard that has them. Any writup on
your build?

~~~
geoka9
I use the left control key on a full sized desktop keyboard as my "palm" key
(I press it with the heel of my left hand). Being an Emacs user, it made my
left pinky so much happier.

This doesn't work on laptops because of the low profile keys, so I stack some
3M "dual lock" squares on the control key to raise the profile. They can be
removed (except for the one glued to key) when I need to close the laptop.

~~~
sedachv
The Emacs keyboard chords were worked out on keyboards that had the Control
keys nearest the Space bar - the intention was that you would use your thumbs
to press the Control and Meta keys. Turns out this is really useful not just
for Emacs but for any program that uses Control modifier shortcuts. I have not
had any hand pain after doing this key remapping on my systems:

[https://news.ycombinator.com/item?id=14985932](https://news.ycombinator.com/item?id=14985932)

------
yangyang
I converted a set of pedals for a dictation machine to work with my Kinesis
keyboard.

It wasn't as useful as I expected. Having to keep my foot in the same place
all the time became quite uncomfortable, and I found that synchronising my
foot with my fingers (these pedals were configured as modifiers rather than
escape - I mostly use Emacs) was quite difficult.

~~~
LeanderK
an intriguing experiment. I am playing the piano and don't expect to have
difficulties synchronising the foot and the fingers. But I may be wrong!

~~~
yangyang
I guess with practise it may well have improved. I just didn't find it
comfortable enough to persevere.

------
inieves
You should consider 2 “presses” for the pedal:

1) quick press-release: changes mode

2) long press-hold-release: changes mode on press and then changes mode back
on release

This allows the user to not have to hold the pedal down if they dont want.

User can specify a time threshold used to determine the difference between a
quick press and a long press

~~~
pogden
Perhaps if it’s released before another key is pressed, the mode stays
changed. If another key is pressed first, it changes back on release.

------
JoshMnem
The pedal idea is funny, but there are too many useful ways to enter insert
mode (i, I, a, A, o, O, c, C, cc, cw, c2w, cit, ci), vi}c, vf.c, v0c, etc.).
It seems like having a pedal for `i` would encourage a way of using vim that
avoids the most efficient keybindings. I rarely press the `i` key to enter
insert mode.

~~~
femto113
I had the exact same thought about the "clutch" aspect of this, but am
wondering if simply having a foot pedal that issued ESC when tapped could
still be of value. On most keyboards the ESC key is the longest reach with my
shortest finger so it winds up requiring a wrist motion.

~~~
suprfnk
> On most keyboards the ESC key is the longest reach with my shortest finger
> so it winds up requiring a wrist motion.

Try to learn using "Ctrl + [" instead of ESC. It helps.

[http://vim.wikia.com/wiki/Avoid_the_escape_key](http://vim.wikia.com/wiki/Avoid_the_escape_key)

~~~
eddyg
Ctrl+C is even easier.

~~~
WorldMaker
Only if you don't like/use modern shortcuts for System-wide clipboards.

------
hawktheslayer
Even though I would probably never go though the effort of it, I am impressed
and love the idea of it. One philosophy that I hear a lot of VIM users
prescribing to is don't make too many custom changes to the bash file that you
can't use someone else's computer. I wonder if you got used to this setup if
you would find yourself pounding the floor on someone else's computer. I drove
stick for years and still occasionally find myself with phantom clutch
syndrome.

~~~
caymanjim
No serious user of Vim would ever suggest that you not customize it. It's
worth knowing the basics of a stock Vim configuration for simple use cases on
a new system or in an environment where you can't or don't want user config,
but if you're writing software all day in a stock Vim configuration, you're a
masochist or a fool.

~~~
colordrops
As a beginning VIM user I started out with the stock keybindings idea. After
using it for nearly a decade, my finding is that it's like learning multiple
spoken languages. It's not hard to switch context and use vanilla VIM despite
normally using lots of customization. But, I do try to keep things idiomatic
and predictable and not override frequently used key bindings.

~~~
SPBS
This has been my experience as well. My vimrc is full of little niceties that
I could live without, but if I end up in a vim without my shortcut keys I'd be
like 'Oh this again I guess I have to :bn :bn instead of <C-q><C-q>'

I haven't really forgotten any of the long form commands that I create
shortcuts for, but it's really annoying using the long forms when typing them
out over and over was the reason why I created shortcuts for them in the first
place...

------
mobilemidget
"During the day it calls itself a Vim Clutch, but at night its name is
pornhubbrowserautohidepanic-button"

Nonetheless, it is a nice device, though I don't see myself relearning a
muscle memory to use a pedal, which I will basically only have at home and/or
work, but not when working somewhere remote on a notebook.

But if I had one, or had to use one, I'd probably bind ESC to it or alt+tab to
cycle through 2 or 3 apps, editor/terminal/browser

------
qq66
I once worked on a piece of lab equipment where I needed to fit a plate into a
robotic dispenser and then click the button to "start program." I didn't want
to keep switching my hands from the dispenser to the mouse so I wired up a
piano pedal to the left mouse button and it improved the ergonomics
significantly.

~~~
TheSpiceIsLife
I've programmed AutoHotKey on my work PC to map pressing both shift keys at
the same to double click the left mouse button at the pointer's current
location.

~~~
TheSpiceIsLife
Replying to myself to add:

So what I really need then is mouse cursor movement by eye tracking + both-
shift-keys for left double click.

Why isn't eye tracking for mouse movement a thing yet?

~~~
lunixbochs
It is, but the first party software is awful for it. The videos you linked
below are a pretty primitive version of what's currently available.

My own project: [https://talonvoice.com](https://talonvoice.com) (only
requires a single eye tracker, has realtime precise movement similar to the
eye+head projects below, and integrates with a very fast and powerful voice
control system).

[https://21clicks.net/share/-L5eU8SeIbUDcgsQa3_l](https://21clicks.net/share/-L5eU8SeIbUDcgsQa3_l)
\- click Replay. This is completely hands-free using Talon's eye tracking and
a noise recognizer (hiss to click). I consider what I have right now to be an
unpolished tech demo, which will get significantly better as I cross many
accuracy/speed TODOs off my list.

These projects require both a eye and head tracker (are still fast and
precise):

\-
[https://github.com/trishume/PolyMouse](https://github.com/trishume/PolyMouse)

\-
[https://github.com/trishume/FusionMouse](https://github.com/trishume/FusionMouse)

\- [http://precisiongazemouse.com/](http://precisiongazemouse.com/)

Miscellaneous, not quite as well integrated:

\- [http://kinesicmouse.xcessity.at/](http://kinesicmouse.xcessity.at/)

\- [http://iris.xcessity.at/](http://iris.xcessity.at/)

~~~
TheSpiceIsLife
This looks interesting, I'll have look later.

Thanks for reminding me of Dragon by Nuance. I first saw Dragon being used by
a quadriplegic guy I used to work for. This was ~10 years ago, he had a bit of
a speech impediment too and it worked reasonably well.

I occasionally think about Dragon and think it might be useful in my 2D CAD
and laser cutter workflow. It actually seems reasonably priced, so maybe I'll
give it a whirl.

~~~
lunixbochs
When I say "fast and powerful", I mean what I've built which can use Dragon as
a backend, not Dragon itself. Their user-facing command system is very limited
(single trigger phrase, bad support for passing arguments to commands, must
pause after talking). I have continuous recursive command recognition (you can
say hundreds of commands in a minute, my record for perfect accuracy is ~280)
and a command system that is leagues beyond Dragon's (and it's free on top of
Dragon).

I plan to build/support professional workflows like CAD. I'd love to hear
about your needs. I strongly believe eye + voice can greatly surpass
keyboard/mouse in many environments.

~~~
TheSpiceIsLife
I’ve sent an email to the one listed in your profile. Thanks.

------
jakelazaroff
It's not just speed. This also improves the usability of vim by turning insert
mode into a pseudo-mode, which is a mode that requires constant interaction
(depressing the pedal) to be maintained.

Pseudo-modes are generally much less error prone than normal modes, the
canonical example being the shift vs. caps lock keys.

~~~
CrystalGamma
Do you have any literature on this being called a pseudo-mode and the
tradeoffs between it and "real" modes? I am currently pretty interested in
these kinds of topics.

~~~
jakelazaroff
I'm sorry, I don't know of any online resources (and after googling, it seems
the more common term is "quasimode") but I can heartily recommend the book The
Design of Everyday Things by Donald Norman. It's a seminal book on designing
interactions between humans and objects, and was required reading in my human-
computer interaction class in college.

------
hoosieree
Map to control and you got yourself an Emacs pedal.

~~~
mfrw
I think emacs needs it more than vim. :)

~~~
Avamander
That reminded me of this greentext:
[https://i.imgur.com/WLzeQMj.png](https://i.imgur.com/WLzeQMj.png)

------
aaronblohowiak
I did this a while ago as well:
[https://github.com/aaronblohowiak/clutch](https://github.com/aaronblohowiak/clutch)

------
tess0r
I stole my wifes sewing machine foot-pedal for a similar project recently
[https://github.com/tessi/programming_paddle](https://github.com/tessi/programming_paddle)
(code there is hacky, don't jude ;))

It's an interesting and easy project to start soldering/arduino-fiddling.
Parts can be purchased with approx. $25.

In comparison to the pedal used in the vim clutch, the sewing machine pedal
has the advantage of not only having an on/off state, but returning the pedal-
pressure (so half-ressed and all sorts of combos are possible).

Currently, I use it for sublime-text shortcuts (cmp+p on half-press and
cmd+shift+p on deep-press) or for debugging (ctrl+d to continue code
execution).

edit: typo

------
stevefeinstein
The reason I learned how to use vi was it's ubiquity. If I develop muscle
memory which requires carrying around a USB pedal I'm not going to have a good
time on any but my own workstation. Not sure it's worth it.

------
pdkl95
When I was first learning emacs and trying to figure out a sane way to type
_double bucky_ [1][2] commands, I happened to read about a project like this
for using pedals as modifier keys.

However, instead of using the obvious hardware approach for the time -
probably using a couple momentary switch pedals and reading them from the
parallel port - I had a much better^Wmore fun idea: use a MIDI organ pedal
board[3]. I already had a MIDI interface (Midiman MM-401), and I had already
dreamed of getting such pedals for regular keyboard use. Having 1-2 octaves
available was plenty of room for all kinds of extra macros and/or hotkeys.

I was half way through writing a simple daemon that would listen for MIDI and
send the appropriate synthetic X11 KeyPress/KeyRelease events when I finally
looked into where I could buy a pedal board, and realized they were $600+ (in
mid-90s dollars). ~sigh~

[1] e.g. "C-M-SPC" for mark-sexp

[2] [http://catb.org/jargon/html/D/double-
bucky.html](http://catb.org/jargon/html/D/double-bucky.html)

[3] anything similar to this: [http://www.nordkeyboards.com/products/nord-
pedal-keys-27](http://www.nordkeyboards.com/products/nord-pedal-keys-27)

~~~
madmod
My friend and I converted an old organ pedal board to digital using some
magnets, reed switches, and an arduino. Mounting the reed switches on foam
board was a fast easy hack. It did require a real organ seat though because of
the length of the pedals.

------
pacmaannn
Great idea! I've messed around with things like this in the past, though I've
used my pedals for music editing and DJ software. I opened sourced my last
attempt, which includes a neat little python GUI to reprogram the keys
([https://www.manykey.org/](https://www.manykey.org/)).

Haven't tried foot keys with an editor, but it seems like once you integrated
them into your workflow they would be quite useful.

------
jeffamcgee
I tried something similar to this, but I didn't like it. After using it for a
bit, I realized I often use commands other than i to get into insert mode. For
example, I may use ci" to edit everything inside a pair of quotation marks. I
wrote a bit more about my setup here: [https://jeffamcgee.com/using-a-vim-
clutch.html](https://jeffamcgee.com/using-a-vim-clutch.html)

------
platz
Clearly what is needed is not a foot switch, but a true clutch a la
piano/sewing pedal.

The farther down you press, the bigger the text size.

Great for presentations on stage too.

~~~
api_or_ipa
Why stop there? Why not grab a MIDI-powered Organ footboard and get a ton of
switches?

You could probably use a bunch of them for programming macros, like moom
layout shortcuts, class skeletons, lock-screen, etc.

------
jzwinck
Around 2001 I made a pedal from Radio Shack parts and connected it to the
Backspace key on an IBM Model M keyboard.

Why Backspace? It was a gift for a friend who had what we called Rusty
Degenerative Typing Syndrome. His typo rate was just terrible.

The pedal did not improve his typing error rate but it night have saves hid
friends a lot of contusion.

------
a-b
This project is very old. I tried it and it was funny at the beginning, but
considering muscle memory this is not something I want to invest in the long
run due to limited portability.

Remapped capslock to control and control + [ works much better.

Vim clutch does not work with standing desk setup ;) don't ask me how do I
know that.

~~~
make3
I'm imagining you at work trying to code standing on one foot while pressing
on the other to insert characters. must be very graceful

------
icholy
I tried this a few years back and really wanted it to work. Ended up ditching
it though. My foot is too slow.

~~~
hannnoi
> I tried this a few years back and really wanted it to work. Ended up
> ditching it though. My foot is too slow.

It seems like riding a bicycle or typing on a new keyboard. At some point, it
becomes natural.

On a side note, I wonder since USB input is polled whether or not it would
make sense to look for a toggle in the inputs rather than using two switches.

------
ChuckMcM
Pretty awesome. I built one of these for world of warcraft to be my 'push to
talk' key for teamspeak. Since I have used it for a variety of things. However
I started with a standard pedal (1/4" phone plug type) and used a Cypress USB
controller dev kit (free from one of their training classes) which had a small
uP and a USB controller on it.

I'll have to see how 'clutch' mode works (I'm a VIM user). There was a person
who showed off a hacked organ base pedal unit that had been improved to send
keystrokes in a similar way.

For me I could see sending one, or two key strokes. Sending 10 or 12 seems
like overkill.

------
emh68
This is cool and all, but coming from the emacs world, all I want is a
keyboard with four meta keys. Ctrl/alt/command/option maybe. All in a row to
the left/right of the spacebar. That would be ideal.

~~~
pdkl95
[https://en.wikipedia.org/wiki/Space-
cadet_keyboard](https://en.wikipedia.org/wiki/Space-cadet_keyboard)

Also, if you have a 104/105 key keyboard with "windows" and "menu" keys, you
_do_ & have a keyboard with four modifier keys. From my .Xmodmap file:

    
    
        clear Mod1
        clear Mod3
        clear Mod4
        clear Mod5
    
        ! left alt -> Meta
        keycode 64 = Meta_L
        add Mod1 = Meta_L
    
        ! right alt -> Alt
        keycode 108 = Alt_R
        add Mod4 = Alt_R
    
        ! left windows -> Super
        keycode 133 = Super_L
        add Mod3 = Super_L
    
        ! right windows -> Hyper
        keycode 134 = Hyper_R
        add Mod5 = Hyper_R
    

Emacs uses all four automatically, as M- A- s- H- respectively.
(alternatively, see:
[http://ergoemacs.org/emacs/emacs_hyper_super_keys.html](http://ergoemacs.org/emacs/emacs_hyper_super_keys.html)
)

~~~
bmn__
Caution, that kills the ISO_Level3_Shift mapping on the regular 105 layout.

Much less intrusive solution is to leave Super_L, Alt_L, ISO_Level3_Shift as
well as the control and shift keys unchanged and simply map Super_R to Meta_R
and map Menu to Hyper_R.

------
danpeddle
how about a myoelectric muscle sensor instead? something like
[https://www.sparkfun.com/products/13723](https://www.sparkfun.com/products/13723)

------
DonGateley
Actually I did think of the desirability of exactly this somewhere around 1984
or thereabouts. It didn't go further than a wish though because the only
access to the Unix system that I'd installed for use by the group I managed
was via dumb terminals and the DIY arena was nowhere near as rich as it is
now. Especially in a building in a corn field somewhere between Rockford, IL
and Belvidere, IL:-)

If wishes were fishes we'd all swim in riches. Really nice job moving beyond
that!

------
dang
Discussed at the time:
[https://news.ycombinator.com/item?id=4141410](https://news.ycombinator.com/item?id=4141410).

------
okreallywtf
I've thought of this for the shift keys, I find that certain key combinations
that require shift are a lot more awkward for my hands to do and I wonder if
year after year eventually that is going to give me arthritis or increase the
chances of it. I think that with a pedal it might make +, -, {, }, (, ) etc
much easier on the hands to complete since they account for the worst
stretches my hands have to make.

~~~
bmpafa
> ... wonder if year after year eventually that is going to give me arthritis
> or increase the chances of it.

This is precisely the reason I picked-up an ergodox [1] when my wrists started
to hurt from `ctrl+whatever` key combos. moving modifier keys to the thumbs is
so obviously superior I'm not sure why it's not more common.

admittedly it felt ridiculous to pay ~$250 for a keyboard (thanks, ebay), but
now i almost never have to contort my wrists into weird angles &

[1] [https://www.ergodox.io/](https://www.ergodox.io/)

------
seniorsassycat
i is the simplest but not the only way to enter insert mode. o/O for new
lines, c/R to replace text. An 'i-esc' foot pedal doesn't grok vi

[https://stackoverflow.com/questions/1218390/what-is-your-
mos...](https://stackoverflow.com/questions/1218390/what-is-your-most-
productive-shortcut-with-vim/1220118#1220118)

~~~
fsavard
I too hated the need to press <Esc> all the time when I started with vi. It
sounded as bad for wrists as the Ctrl key for Emacs.

The trick I've found (I don't remember where) and used ever since is to map
the "kj" sequence to <Esc>, since it's otherwise unlikely in normal text. It's
just a simple instruction in the vim config:

:imap kj <Esc>

That foot pedal is a cute project though.

~~~
mkl
Alt-l (lowercase L) works out of the box and doesn't move the cursor. I also
map a press and release of capslock to escape for when I need that (it's
control the rest of the time).

~~~
fsavard
I just tried this and Alt-l seems to move to the line above (equiv. to Esc+l),
Alt-J the line below, and in gvim it produces some accented characters for me.
It would have been a good combination for finger movement though.

------
zeristor
This reminds me of an ArsTechnica story from some years back, $500 for some
rugged steel pedals for a flight simualator:

[https://arstechnica.com/gadgets/2015/01/want-high-end-
flight...](https://arstechnica.com/gadgets/2015/01/want-high-end-flight-sim-
pedals-put-500-in-a-polish-bank-account-and-contact-slaw/)

------
hunta2097
This is a surprisingly low tech solution. You could program a digispark to do
this for $3.

Two USB ports and controllers just to press I and escape? Crazy.

------
jxramos
I use foot pedals used in the transcription space such as something a
stenographer would use. Philips makes good foot pedals. They're pretty robust.
There's utilities for reprogramming what the button press triggers, mine's set
for copy / paste. Pedable is good, and there's an advanced tool called
ControllerMate worth looking into.

------
tetraodonpuffer
I have been really tempted by the ergodox ez, but really wish it supported
pedal input as that would make a "pedal layer" super easy access.

I do play the organ and drums and have been most of my life, so maybe that's
why the idea of having additional keys available via pedals is right up my
alley :)

~~~
hiaux0
Hey, I have an ergodox ez. I'm wondering what you mean by "pedal layer". Like
pressing the pedal would move you to another layer?

The ergodox does precisly that and supports up to 32 layers.

~~~
tetraodonpuffer
that's what I mean, having a pedal connector on the keyboard where I could
plug a pedal in and use it to switch to a different ergodox layer (which as of
now I assume you do just via another key). The kinesis does have a pedal
input, but I don't think the ergodox ez has it, or does it? the website does
not say anything about it...

~~~
hiaux0
My bad. No the ergodox doesn't has this.

~~~
tetraodonpuffer
no worries, who knows, maybe in a future revision it might

------
bringtheaction
> Has anyone thought of this before?

Yes I overheard a conversation between two guys once where one talked about
using a hardware pedal with Vim and the other jokingly replied “are you going
to install a steering wheel and a gearshift also”.

But in all seriousness I think a good pair of pedals could potentially be
nice.

------
richard_todd
It makes me wonder: Maybe a two-pedal system (ctrl and meta) for Emacs would
avoid carpal tunnel issues.

~~~
geoka9
I described a quick setup that helps me tremendously (see my comment elsewhere
in the thread).

------
soperj
It's pretty cool, but all i can think of is that I would need different pedals
for i, I, a and A, since I use them all about the same depending on where I
want to edit.

------
hwestiii
I always thought Emacs was the one that needed foot pedals.

------
stcredzero
Back in the late 80's, my housemate told me about his coworker who made a
footpedal ESC key to make his EMACS editing faster.

------
Waterluvian
I've thought about something like this for a long time. Not for coding but pc
use and gaming.

~~~
muzzio
Same here, always thought it would make a great push-to-talk button for voice
chat.

~~~
consto
If you are currently using your keyboard for push-to-talk and your mouse
allows it, I highly recommend binding the/a side mouse button to push to talk.

------
fiatjaf
I want videos of people doing this.

~~~
ZenoArrow
[https://www.youtube.com/watch?v=_sYtX2x83sU](https://www.youtube.com/watch?v=_sYtX2x83sU)

[https://www.youtube.com/watch?v=Hww3XorG418](https://www.youtube.com/watch?v=Hww3XorG418)

[https://www.youtube.com/watch?v=aVLEXlNAxpY](https://www.youtube.com/watch?v=aVLEXlNAxpY)

~~~
fiatjaf
Thank you.

------
sologoub
Wish there was a way to do this with iPad/ssh, maybe over Bluetooth?

------
bigbadgoose
i always thought it would be awesome to switch between dvorak and qwerty using
a pedal, where you keep switching between the optimal key layout for the next
set of characters

~~~
raihansaputra
use it with two pedals and you can make a 2 row keyboard, with the bottom row
exclusively for space and modifiers

------
idrock
Wrong. (being the first to do this that is.) One of the creators of the Zeus
web server did this writing Zeus while in college. Still a great idea, and of
course, vim is awesome.

------
mchahn
I couldn't use this because I only work on a laptop on a couch. I haven't sat
at a desk in years. (And yes I also exercise to stay alive).

------
jwilk
(2012)

~~~
LastZactionHero
I was going to say, what's with the Mac Pro tower?!

~~~
hultner
I still use a Mac Pro tower at home. Put a Sandy Bridge CPU, 32GB ram and SSDs
in raid, still runs great today.

------
AdmiralAsshat
Last commit on the repo is 6-7 years ago, so a "(2011)" or "(2012)" tag would
probably be apt.

~~~
dang
Added. Thanks!

------
justin_vanw
With this contraption you'll be nearly as efficient as out of the box Emacs!

