this post was submitted on 16 Jan 2024
188 points (78.1% liked)
Programmer Humor
32558 readers
1000 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I built myself a foot pedal that presses F14. It's super useful as a global hotkey 'cause nothing else uses it. :P
This is good. I've been looking for a way to assign a foot pedal as a global mute toggle. This might be a good first step. I like it.
Thanks for the idea.
I bought an existing foot pedal off aliexpress. It came with a little dangling wire, supposedly meant to be hooked up to a piece of industrial equipment. Opened it up, removed the existing wire, soldered a wire to a suitable arduino dev board and hot glued it inside. If you want I can dig up the exact parts I used and even the code. But I also suspect maybe you want to figure it out yourself?
Some bits I can certainly figure out. The Arduino code is the part I'll be very bad at; so if you can get that without too much trouble, I would appreciate it.
I'm sure I'll use a different pedal than what you did, since I don't know if the supply availability will be the same, but honestly, it's just a fancy switch designed to be used by a foot, so I'm sure it's nothing difficult.
If it's too difficult to find the code, no worries, I'm sure there's plenty of examples around the internet of similar types of code for different purposes (like a shortcut keyboard or something). I'm certain that we're not the first and certainly not the last to want something similar in function.
Here's the code I wrote:
Note that the #include was meant to use angle brackets, but Lemmy ate them. If this doesn't work, change it back to angle brackets around the Keyboard.h instead of quotes.
Also, the parts I used:
I wired it up like in the photo, and just laid it on a bed of hot glue so the USB port sticks out the hole. I had intended to get a mini USB extension cable inside the pedal, but the one I ordered turned up defective, and this worked out just fine.
Excellent. Thanks for digging this up.
I'm just wondering what you used to bind F14 to do something on your PC? Some companion application?
Discord push-to-talk. :P
I just noticed lemmy didn't like the #include statement because it uses angle brackets. I tried to update it but it doesn't look right, so I'm going to change it to quotes which should work the same, I believe. I'm not a C expert, I usually code in C#.