6 ms·
DIY control pedal on Linux
- dest 11y agothis project is great! after a quick research, it seems that esd might be a bit outdated now [1] and that more recent sound API could be used. it seems however to do the job just fine. [1] http://www.linuxquestions.org/questions/programming-9/esound-client-programming-57017-print/ http://www.linuxquestions.org/questions/programming-9/esound...
- Rogach 11y agoYes, if people say that esound was already outdated by 2003, then by now it should be very much dead. But I was more focused on completing this project than on researching sound APIs, thus I simply took whatever Xoscope guys used. After all, we simply want to read voltage level from simple input - why should we need to invent new library for it every 3 years?
- gherkin0 11y agoThat's a neat, different way to do it. Nowadays I think most people would go straight to building something with Arduino (e.g. http://apcmag.com/arduino-project-usb-foot-operated-mouse-switch.htm/ http://apcmag.com/arduino-project-usb-foot-operated-mouse-sw...), but that's not always necessary.
- Vexs 11y agoThat's what I was thinking when I was reading this, an 11$ teensy uC could do the job very easily, it's got a keyboard emulator built in. I love the teensy uC, it's completely replaced the arduino for me. So much cheaper and more capable.
- donquichotte 11y agoCool, low budget hack requiring almost no additional hardware! The author states that "the signal is too strong for our input and goes off-scale, making it almost impossible to reliably detect pedal press/release events". Since the two waveforms are visually quite distinct, it is probably possible to correlate the incoming signal with reference on and off waveforms to detect a state change reliably without using hand-crafted heuristics.
- Rogach 11y agoYes, that's what I tried - but there was a case when next press or release happens while signal is already off-scale from previous event, and I failed to find any sane way to solve that case. Also, the scale on the images is 500ms per one red square, so you can see that waveforms extend over hundreds of milliseconds - thus there will be unbearable latency with that approach.
- donquichotte 11y agoThanks for elaborating!
- TheCams 11y agoIs anyone using a pedal in addition of a keyboard on a daily basis? Do you really think this could be a significant help when typing code?
- Rogach 11y agoI use it exactly for that, and it really helps me when navigating in Emacs (holding Ctrl with pedal is much easier than holding it with your pinky). Your experience may vary, of course.
- userbinator 11y agoVIM users may also benefit: https://news.ycombinator.com/item?id=4141410 https://news.ycombinator.com/item?id=4141410
- Rogach 11y agoThat project was my inspiration for this hack :)
- aidenn0 11y agoInteresting enough, the ancestors of emacs were on a keyboard where the meta and control keys were in the lower-left corner, and it was somewhat expected that you would move your entire hand to do chording on those while using the other hand for the letter keys. I imagine that resulted in far less pinky-strain. Knight keyboard: http://world.std.com/~jdostale/kbd/Knight1.jpeg http://world.std.com/~jdostale/kbd/Knight1.jpeg Later followed up with the space cadet keyboard: https://en.wikipedia.org/wiki/Space-cadet_keyboard https://en.wikipedia.org/wiki/Space-cadet_keyboard which added super and hyper.
- tenfingers 11y agoI'm using a kinesis keyboard with the "savant" pedal, which can be configured to do anything you need. I used it for a while as "shift", then ESC and control, then I stopped. Not so much because it wasn't efficient (I still think it's better than using caps-lock, not so much for other keys), but because it enforced a more rigid posture when sitting. I like to move the feet a lot, and change the sitting position. Instinctively I tended to stay more rigid instead of moving the pedal. But YMMV. If you tend to abuse shift to capitalize words, a pedal is worth considering. I also just used a mouse attached to a piece of cardboard, controlled with the foot just by sliding it on the ground. Just too hard to control fine movement. I briefly tested just a mouse with the bare foot, but the foot joint just doesn't has the versatility of the wrist. It was also annoying that I had to use a keyboard combo to perform the clicking (since I used the toes to hold it). Trying costs nothing though, so have fun and try for yourself. Pick a crappy keyboard, and construct a lever with a V shaped piece of cardboard. Position the pin on the back on the key that you want to "try". It won't be as rigid or comfortable as a pedal (you cannot "rest" on it), but you can get a feel of how it works. I let several of my colleagues try the pedal since I don't use it anymore, but it's not something that is easily appreciated. It certainly requires some training to get used to, especially to generate control sequences. I would advice to try one before buying for this reason.
- sebisebi 11y agoIT is actually possible to build a very simple pedal yourself. You can tape two tinfoil "electrodes" on cardboard and fold it so that they touch when it's completely folded. Then also put some sponge between the folded cardboard so that it releases reliably. If you connect a mono audio cable to the electrodes you have a working pedal. This worked in a pinch for an electronic drum set and it is also much quieter than a real pedal.
- pkaye 11y agoI see an iKKEGOL USB foot control switch on Amazon for $13.99. Can't you hook that up to any software?
- saulrh 11y agoSome of those cheap USB foot pedal switches have a disturbingly custom software architecture. When I bought one off Amazon, it turned out to not even be HID - it needed special drivers and everything. Even the ones that are HID-compliant usually demand some custom software for initial setup ("which key do you want me to pretend to be?") that invariably only speaks windows. Which is annoying, because this really should be just a full-hardware solution that speaks USB HID and uses a set of DIP switches on the back for the desired scancode.
- Rogach 11y agoThat was my first thought - I selected some generic USB pedal, but it failed to arrive, so I used what I had at hand. Also, there could be a problem with pre-made USB pedals - they may only transmit events on pedal down, like it happened for Vim Clutch author (https://github.com/alevchuk/vim-clutch https://github.com/alevchuk/vim-clutch).
- simgidacav 11y agoThe troll of the day: > How about using ViM? Thanks for sharing, this post made my day.
- lasermike026 11y agoEmacs people...
- platz 11y agoI remap LALT to CTRL so i can hit it with my thumb
- pavel_lishin 11y agoObligatory complaint about Blogspot breaking back-button functionality; cmd-[left arrow] does nothing, cmd-[right arrow] takes me to the next article. Who thought this was a good idea?
- slig 11y agoAt least they are consistent and break the back swipe on mobile as well.
- tedwilliamsis 11y agoI did something similar once, entirely in hardware, by soldering a normally-open foot pedal switch to the keyboard's controller chip. In most keyboards, a keypress is registered during the connection of two conductive pads on two separate membranes, each of which contain a trace back to a controller chip. You can take a keyboard apart, look at where the Ctrl key is, then visually follow the traces back to their respective pins on the chip. Soldering a switch to those two pins will register with the keyboard exactly as if that key were pressed.
- zwieback 11y agoWould a voltage divider help the overvoltage problem?
- TheRealDunkirk 11y agoThis was my immediate thought, but then I got confused. Where does the pedal get it's voltage to generate the signal to begin with? From the audio jack itself? If that's true, why does it return a signal too high for the sound card to handle? Is there some sort of voltage amplifier in the pedal that can be bypassed?
- jononor 11y agoIf the voltage comes from the audio jack, it is the DC used as the bias voltage (for electret microphones). Typically 1.5 volts, which is likely way higher than the AC signal range of the input (likely to in the order of <100 mVp-p).
- almightysmudge 11y agoPedantic, but that's not a TRS connection.
- CephalopodMD 11y agoNow this, my friends, this is a hack.
- ChuckMcM 11y agoOn the one hand I cringe at using the audio input for effectively a DC signal, but on the other hand it is probably sitting there unused on a lot of machines so it isn't like you're losing a capability. As with many folks I'd probably use a small uC and have it emulate a keyboard (maximal re-use of known interfaces) but hats off to the creative use of pulseaudio.
- grymoire1 11y agoI needed a programmable USB foot pedal for my Linux system, as I wanted a hands free way to give a presentation, so I bought one from https://www.delcomproducts.com/webpage.asp?id=32 https://www.delcomproducts.com/webpage.asp?id=32 for $40.