Electrical – Wiring a momentary button to USB

hidusb

Please forgive my lack of knowledge as all of this is VERY new to me… old dogs and new tricks and all 😉

I want to wire a usb cable to a simple momentary button to use as a push-to-talk button. I've done some LIGHT FIT stuff; built button boxes with zero latency boards and such, but I'm not sure how to find this answer. Heck, I'm not really sure how to search the question.

The button is 2 prong of course. I don't want to utilize a board (learning arduino now, but there's no room for a board in th his project) if it can be avoided, but would rather just have the button connected to the cable and plug it in to have Windows recognize it as a button.

Can I simply wire this button to a usb cable? If so, what fills the remaining 2 positions on the USB connector (data pins I believe) if anything? I don't want to blow up my newly built pc 😉

Thanks in advance for entertaining my ignorance.

Best Answer

Cheapest and simplest solution I know of is to find an old USB PC keyboard.

Extract the small circuit board from it.

Run xev on your Linux machine to find which two contacts you have to short together on the board to get some character as an output. You can also trace out the patterns on the keyboard membrane to do this.

Then buy any momentary button and connect it to the two contacts you found.

This way I have PageUp/PageDown footswitches for my notes, when I play piano.

This is home made footswitch from an old PC USB keyboard - it sends PageUp PageDown signal and turns pages when playing piano.