Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Using foot pedals for modifier keys in Linux (2014) (techtrickery.com)
112 points by luu on April 1, 2022 | hide | past | favorite | 78 comments


I've gotten a lot of use out of using a sim-racing shifter (specifically Thrustmaster THA8) as an input device in Linux: https://photos.app.goo.gl/DksPS2ijo9aPCUi5A

These shifters are normally designed for use in sim-racing/gaming, but I haven't sim raced a single time in my life. The shifts can be reconfigured for various actions, and I use it for things like switching workspaces or various emacs bindings.

It's extremely mechanically satisfying to use.


That makes me laugh. To imagine how you’re sitting there at your PC switching gears. My grandma would be totally confused, haha.

But I like the idea. Would also be interested to know how you’re using it!


Oh god now I kinda want this. I am saved by the fact that I can't think of a way to use this that fits into what I do but I want this.


Between this and the Simula One, I basically desire to emulate your entire setup. Nicely done


Working on both =]


This looks really interesting. Could you provide more details on your setup?


I use qjoypad (https://github.com/panzi/qjoypad) to configure each shift to a single number press. So for example shifting into 2nd gear sends a single "2" key press to Linux.

After that, I usual xbindkeys & emacs to configure more complex bindings. So for example "WindowsKey + n" is configured to go into workspace n. Or "CapsLock + 8" is binded to close the current tab I'm on.


You could improve on this using F13-F24 as they're pretty much universally supported by X, SDL, etc.


Whoa. Interesting idea!


Add a foot pedal as the clutch to add modifier key to the gear shift!


Angrily shifting gears to go build after a long session seems a nice idea!


Whoa. I guess I now know what to save up for for my birthday.


What a brillant idea... I have sim-racing gear amassing dust in the garage, you make me want to try it out...

I probably won't but only because the Logitech shifter I have requires to be plugged in to the whole steering wheel assembly which would be bulky to have around the desk...


How about mounting the steering wheel on the floor and use it as feet controllers via rotation. Turn right to scroll down, left to scroll up, and turn more to scroll faster!


oh damn...you also need a big red button to kick things into turbo/overdrive for the serious hacking


or use it as the build/test button!


> mechanically satisfying

Magnetic shifters with a direct drive wheel are positively orgasmic then.


That is a very interesting idea my friend.


Does it come with a clutch pedal?


Foot pedals. I'm using one with three axis for flight simulation. One day I ran linux on the computer they were connected to, not "using" them, just connected.

Suddenly, without any warning, my screen turned left/right/upside down like it would on a tablet.

After the initial surprise it took a bit of time to figure out that it was caused by stepping on the pedals. And even more time to figure out that anything unkonwn with three axis is considered an accelerometer, and that an accelerometer defaults to turn the screen in gnome.

It was a long time ago. I haven't checked recently if there's finally a hwdb or whatever is needed for systemd to do some meaningful mapping.


I've tried using foot pedals like this before but there were two issues which made it not work.

1. You need to keep the ball of your foot raised when not pressing the button, which leads to an ache super quick. And foot switches tend to be pretty tall. The actuation distance is also pretty large.

2. The fact your foot is raised messes up your sitting balance. And you need to keep your foot in the same place all the time: no spinning your chair, no leaning to the side, shifting your weight, etc.

I'd like to see a good foot input device. Maybe something attached to the foot?


Could you invert it and only apply the modifier when your foot is raised?


About #1: it takes about a month of sim racing for these muscles to develop. After a while, you even forget it used to be hard.

About #2: That's why you have special seats and rigs in sim racing. Your position is more at an angle and not fully vertical. Never expect a normal gaming chair to be of help for this.


Learn vim and map the pedal to the Esc key.


I actually do use vim (well, evil mode in Emacs), and I did set up a footswitch and did map it to esc. It was really annoying, for all the reasons OP mentioned. I guess I also didn't realize how much I vary my sitting/standing posture during the day but keeping my foot over that footswitch really didn't work for me. It also felt slower but I'm not sure if I would have gotten used to it, I don't think I even made it a day before i realized this wouldn't work for me.

This was during a strange time when I experimented with like....i wrote some code to recognize chords on a midi controller and map them to key sequences, so like C-major->switch to home desktop. that was kind of funny. The only thing that was even vaguely useful from all these footswitch etc experiments was using grid of drum pads as window management tools. e.g. shortcut to four virtual desktops = top row of four drum pads. But even that I don't actually use.

anyway, ymmv


I also used a foot pedal for a normal toggle and neither as toggle nor as clutch did the trick for me. I wouldn't use it again unless it was attached to my shoe in some way.


> I'd like to see a good foot input device. Maybe something attached to the foot?

Perhaps an accelerometer in your shoe?


Same here, trying to coordinate foot and finger combinations is a little awkward to say the least.


This takes practice but can work very well. Look at organ or piano players.


There was a point when this was joke poking fun at emacs users. With time, it makes more and more sense. Foot pedals offload some strain from your hands to your feet which in theory sounds healthier when it comes to joints. They may even improve blood circulation to your feet. Something which is quite desirable given the sedentary nature of computer work.


Right on. I've noticed in general, there's a lot of derision towards anyone using non-standard/ergonomic equipment.

I use a split (Dactyl Manuform) keyboard with qmk, and there's no end to the ongoing jokes about my "nerd keyboard", even from fellow programmers.

I can live with the jokes though. The keyboard cured my RSI and saved my career.


I have recently moved the ctrl key away from the "caps lock" position on my Ergodox and onto the thumb cluster, it's already improving the strain in my pinky. I took the initial move since the corner position is about the worst kind of stretch for a lot of key combinations, but with the amount that I use the ctrl key there's no doubt in my mind I should be using my strongest digit.


Yeah, if you have thumb clusters I definitely recommend putting modifiers on them. The thumb is one of the strongest digits, yet most only use them (or one of them!) to press a single key, the spacebar. What a waste.

On my ergodox the two big thumb keys on the left are control (escape when tapped) and alt. I don't use the other thumb keys as they aren't comfortable to type. The two right thumb keys are space and enter.

My thumbs have thanked me for the past nine years.

https://hairysun.com/revisiting-the-ergodox.html


I want to some day prepare a captain chair Star Trek style, and put one half of a split ergonomic keyboard into each arm of the chair.

Don't pay attention to the jokes. More than half of their origin comes from envy.


Possible satire, but conceivably practical: Emacs user links modifier foot pedals to generator, powers own computer.


Although I'm a vim user, I took inspiration from the many emacs users who swap left control and caps lock. For me, it's worth having for ctrl-l alone. After getting used to it, I can never go back.

    setxkbmap -option ctrl:swapcaps


I did this for a while, but I was getting RSI-ish symptoms in my left pinkie after a while.

If you ever get that as well: What works for me is swapping the left Alt and left Ctrl keys (without other keyboard changes). I happened to never use alt for anything combined with a right hand key, and now I can access the left Ctrl with my thumb.

Hacker man!

Edit: left Cmd and left Ctrl on mac.


Oh, believe me, I would if I wasn't already using alt as my modifier key for navigating my window manager


I did this! I electrically extended the two keys on the bottom right of my keyboard (a 4 row 12 column Let's Split [0]) to two switches that you'd use for, say, running a drill press. I used hold/tap to give them more functionality, so one was shift/tab and the other was command/enter. I could change applications pretty smoothly with Command Tab and it was satisfying to send a command line command on its way with my foot. The switches were heavy enough that I could rest my foot on them without pushing them down at all. But it was weird keeping my foot in the same spot the whole time; I'd rather fidget and move them around. If I make them work with my Iris [2] (possibly by making a third half of it on the i2c bus) I'd strap the switches to my feet.

[0] https://keeb.io/products/levinson-lets-split-w-led-backlight

[1] https://www.ebay.com/itm/372481343130?hash=item56b99e3e9a:g:...

[2] https://keeb.io/collections/iris-split-ergonomic-keyboard


My trackball, a Clearly Superior Technologies L-Trac (I know best name ever), has 3.5mm ports that you can hook external switches in.

For a while I tried putting these switches below where my palms are when I use my ErgoDox keyboard. One was set to the command modifier on Mac and I don't remember what I set the right modifier to. I guess that is because I rarely used them (given that the ErgoDox places at least 4 keys under my thumbs).


I use a small two-way KVM-switch for my main setup in the living room (GF demanded that my main setup was in the living room so that I wouldn't spend too much time in my lab). The KVM-switch has an external button on a wire to switch between two computers . It fell behind the desk a few years ago, and now I just use my foot to switch between computers. It works well.


Side note, it anyone is experiencing pain in your pinkies, another option is a keyboard where the action keys are offloaded onto the stronger thumbs. Personally I use the Kinesis Advantage 2 and it has been amazing

https://kinesis-ergo.com/shop/advantage2/


"Foot pedals", what a lovely pleonasm


I don't encounter unfamiliar words often - thanks for that!


I 3d-printed flexible overlay over usb switch to make a foot pedal that switches keyboard and mouse between my computers. It's pretty handy.

Basically this https://live.staticflickr.com/65535/51976931606_3a854f959d_c... is duct taped over this https://m.media-amazon.com/images/I/61PnQO-fmzL._AC_SL1485_....


I used to think this was a good idea, then I found out about the "motor homonculus": https://en.wikipedia.org/wiki/Cortical_homunculus I see it as the 2nd image down in the right hand column.

Your feet are just never ever going to be as coordinated as your hands. I guess an on-off pushbutton would be ok, but a "mole" (mouse moved by foot) will never have the accuracy of a hand-manipulated mouse.


Well that's a neurotypical illustration corresponding to a typically developed brain with typical usage patterns. People who can't use their hands or train a lot with their feet can display astounding dexterity.


Very true. Just think of Bach. The man was a master at the organ, with his hands as well as with his feet.


And of course, we're all about as good as Bach with our hands and our feet. Said everyone who's ever tried hacky sack.


No. But how would have Bach ever gotten any good at this if the organ didn’t have foot pedals? For instance because the designer would have believed that “people just weren’t as good with their feet as with their hands”.


I mean, maybe not as coordinated the hands, but try telling an organist[1][2] that feet can't be coordinated.

Models are just that, models. They often don't actually reflect reality.

[1] https://en.wikipedia.org/wiki/Pedal_keyboard

[2] https://www.youtube.com/watch?v=J4XeClV_NCQ


Watching a skilled organist do their thing is mind blowing.


This has little to no bearing on learning to use pedals, which are designed specifically for feet.

Ask any rock guitarist or concert pianist how they feel about stomping pedals while doing fiendishly complex things with their hands.


So why is it that race car drivers never use their fingers to push an acceleration or brake button?


Formula 1 drivers do a lot of that on the steering wheel:

https://www.roadandtrack.com/motorsports/a26827434/2019-merc...


They certainly don't. Most of those buttons are for changing the settings on the car and are used rather infrequently.


Presumably because they've got their hands full. But I agree that you can apply some varying degrees of finesse with your foot on the accelerator pedal of a car, pretty clearly (good thing, too).


Response time was ultimately why I discarded foot pedal after going trouble of setting it up. Brain to foot response time was too long for me and it significantly degraded productivity, especially since modifier keys are meant to be pushed in sync with other keys.

Foot pedal works for music because in music you plan to push the pedal ahead of time, whereas in programming it is a snap decision and therefore requires low latency reaction time.

Not sure if it was a matter of training.


> Not sure if it was a matter of training.

Probably not. IIRC, nerve signals are actually much slower than we like to imagine, but our brains plays tricks with our memory such that we don’t percieve it.


I've been using the Olympus RS31H for control (left), shift (right), meta (middle), and super (top), which is all right, but reaching the top pedal is a bit cumbersome, because one has to raise one's whole foot. (Beware that, although it works on Linux, MS Windows + further proprietary software is needed to configure this.) I imagine organ pedals would be better, but I haven't found anything promising.


Aside from foot switches, you could mount "knee switches" which are just more foot switches glued to the underside of your desk.


Great use for a foot pedal: momentary mic unmute

aka: PTT or push-to-talk


When I had a sim racing rig, I used the pedals to scroll up and down.

There are a few programs in both Windows and Linux to assign joystick axis to actions.

It was amazing.


You can use piano foot pedals too.


Interesting. Anyone have any experience reprogramming those?


I'd just be happy of trackpad support was consistent and reliable.


I am super into macro keys and I have been thinking about buying a foot pedal for ages. Aside from my 5 dedicated macro buttons, I have remapped the numpad buttons, the function buttons and several other buttons to macro functions. I also use a mmo mouse which has its own set off macro keys. It doesn't stop there as I am using HIDmacro to remap several keys own my laptop's keyboard. I also use AHK.

For the average macro lover getting a foot pedal has very little utility to offer but it does sound cool. The productivity bump of footbpedal is non-existent. But like homeopathy if you feel good about using something you will find it to be effective somehow.


Adding extra limbs as input devices is more useful than I'd expected, after taking the risk to buy some foot switches and other input controllers! I don't think the specific models or sellers matter that much; I'm just a happy customer.

It's my plan to hack the volume controllers into an Arduino's ADC input, and make them act as a USB keyboard for the computer's volume control. When I have some more time in the lab...

Feet:

• Product: AliExpress/Nimluxe Store/"2 In1 Wireless MIDI Controller Pedal USB Bluetooth MIDI Foot Controller Volume Expression Pedal 4 Buttons Footswitch"

Hardware: USB-C to USB-A cable, included. Apparently also Bluetooth.

Software: On Windows, arrow keys. On Mac, customisable shortcuts using /Utilities/Audio MIDI Setup and BetterTouchTool.

Example use case: On Thursday 2022-03-31, I was filling out a form on paper. I'd already completed it in Excel. With my left hand I held the paper, with my right hand, I wrote with the pen. Instead of letting go of pen or paper, I used my foot to press the arrow key to scroll down. This made it easier and faster to verify my transcription.

Usage frequency: 1 time in 2-3 weeks. Might use it more with an analogue pedal.

Hands:

• Product: AliExpress/VINSHLE FACTORY STORE Store/"Audio Sound Mixer Headphone audio Amplifier Mobile Phone Audio Sound Mixer Pocket Mixer 3.5mm Interfaces with Power Adapte" (also known as K1000)

Hardware: 3.5mm audio jack input (x2) and output (x2). miniUSB for charging, internal battery.

Software: None needed.

Example use case: It's an op-amp. Excellent for listening for ground loops in an electronic circuit. Also useful to change music volume quickly.

Usage frequency: Daily at work for music, occasionally for electronics debugging.

• Product: AliExpress/Unisian Global Store/"UNISIAN Audio Volume Wired Controller Aux 3.5mm Signal Volume Control by Cable Adjustment For Speakers Amplifier System"

Hardware: 3.5mm in (x2), 3.5mm out (x2)

Software: None needed.

Example use case: volume control by turning the dial up. It's big enough (10 cm or so?) to feel like scratching a turntable. Very fun.

Usage frequency: Daily at work for music.

• Product: Monogram Creative Console

Hardware: USB-C, I2C, magnetic pogo pin connections

Software: on Mac, can interface with everything via AppleScript. There is a Windows app, but I haven't played with it as much.

Example use case: changing computer volume and brightness. Can be in music, photo editing, video apps, or customisable.

Usage frequency: The hardware looks so beautiful that colleagues keep borrowing it.

Overall conclusion:

If you want to travel and pack small, these are excessive luxuries. There is usually a software solution instead, but it's easy to lose focus.

If you have a stable desk, ergonomic hardware is a great investment in feeling comfortable and working more efficiently in limited time.


I know I'm going to get downvoted for this, but this is just ridiculous. Typing isn't piano or weaving, folks. Lots of keys on a keyboard! You never need to press 10 keyboard keys at once => you don't need a pedal. VIM also has more tricks than one person could ever learn.


When you're deep in a program, it's not uncommon to have a ton of keyboard shortcuts. More than just command-x can cover. More than adding in command-shift-x will cover. Maybe even more than three-modifier commands will cover. And hitting, say, command-alt-shift-d is a heck of a finger twister.

So you start looking for more keys. I use Karabiner to turn capslock into command-alt-shift and fn-anything-but-a-function-key into command-shift. Or you make a keyboard with more keys - look up the "Space Cadet Keyboard" for a classic example. Or you get a couple of foot pedals.

(Foot pedals have other uses, too - transcriptionists have pedals designed to act as transport controls for the playback of the audio they're typing, so they never have to take their hands off the keyboard. I'm told they help speed things up a lot.)

You also don't necessarily have all those keyboard shortcuts memorized. But if you operate on a principle of "anything I need to do twice in ten minutes probably needs a shortcut so I can do it a ton faster next time I gotta do it a lot" it's easy to accumulate them, in any tool.


Interesting about transcriptionists that makes perfect sense to me but still very unique to a particular task just like piano.


What program do you need more than say 20 shortcuts for?


Adobe Illustrator. I’ve been using it as my main art medium since 2000 and I run it with one hand on the keyboard and one on the Wacom stylus.


My buddy works at Intel and in his onboarding they asked: where do the most workplace injuries happen?

The office. Carpel tunnel is a PLAGUE for older engineers. We all have a ticking clock.

So for me a pedal is about saving my hands from stretching and mmoving and delegating that to a larger, stronger muscle/skeleton group.


I know this sounds ridiculous, but my left pinky is a hot head that doesnt want to play nice with the rest of it's siblings. Its crazy how often I try to convince myself that one day I'll buy a foot pedal and use it as a shift key.


People with ache or other issues can definitely benefit from not having to use all keys on a keyboard.


You don't need 10 keys! You just need 1s and 0s!

>You never need to press 10 keyboard keys at once

https://en.wikipedia.org/wiki/Chorded_keyboard

Do you just hate everyone without 10 fingers? There's more than one reason to alter your keyboard setup.


> Do you just hate everyone without 10 fingers? There's more than one reason to alter your keyboard setup. No, they do not hate people with less than 10 fingers. As you typed that out, and before you pressed send, this should have been obvious to you. This sort of comment flagrantly breaks the HN guidelines, which is very disappointing because it could have easily been reasonable. Find a more mature way to disagree.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: