When you are recording yourself, playing guitar or bass, a good thing to have is a foot-switch for play/record, so you wouldn't have to reach for the mouse or the keyboard, while handling your instrument, when re-recording, or when you need a play-along track to stop or start.
In most recording software space bar is assigned for start/stop play-back. And when you are recording, you arm the tracks, and press record, and then play to begin recording (in Cubase you have to turn off SYNC on the transport bar to have it work this way).
I had an old USB keyboard, and a small switch, and wanted to try and hack the keyboard so I can connect the switch to work as my space bar.
Step 1: Tracing the Path
Open the keyboard. Inside you will find a small circuit, and two plastic sheets that have printed conductive tracings. There is an isolating sheet between them with holes where the spots on the two sheets meet and act like a switch when you press and join the two conductive spots together, to complete the circuit. Every spot acts like a switch, and the conductive print on one sheet leads to one set of pins on the circuit and the other will have tracings that go to another set of pins on the circuit board.
There is a grate instructable that explains this in greater detail, check it out https://www.instructables.com/id/Hacking-a-USB-Keyboard/
The only thing I had to do here was to find to which pin on the circuit board goes the conductive printing from the spot (used for space-bar) on the first sheet, and then find the corresponding pin by tracing the path on the other sheet. It is like a maze so be patient with it, mark it and be methodical.
Step 2: Soldering Wires to the Circuit-board
Once you found the two pins, it’s time to solder wires to them. The solder wont bond to the circuit board unless you scratch some material off the pins, clean it up and put some flux on it. Put some solder on the wire first and then solder the wire to the pin. The wires will be later soldered to the switch.
Step 3: The Switch and Housing
The type of switch I used you can find in small electronics, computer mouse etc. The switch you are using must be a ”push-to-make" switch a type of biased switch that makes connection when you push on it and brakes the connection when you let go.
I had one big robust switch, which was unpractical to install, and one smaller which is the actual switch that is doing the job.
The big switch is kind of a housing for the smaller one. The bigger switch has a spring in the upper part and a pin that is pushing down in to the lower part, where the connections were made. I screwed open the switch and pulled out the parts that were making the connections.Then Ive put the smaller more sensitive switch inside so that the pin is pushing down on it.
Next you need to have some kind of housing. At first I wanted to use Altoids tin to house the circuit board and the switch, but I found something better. I had saved the transmitter from my old wireless keyboard that has broken down and its housing was perfect size for this project. After taking it apart, I've put in the big switch in first. The hole for the connect button was the perfect size for it.
Next I soldered the wires from the circuit board to the small switch, then inserted the smaller switch in to the larger one and glued them together. I fitted in the circuit board, kept it in place with melted plastic with the glue-gun, Screwed the top and bottom of the housing in place, and used some glue so secure the USB cable, because it was smaller than the hole in the housing.
The switch must be big enough and robust enough to be handled with a foot. The housing you chose must be tough and endurable, aluminum tin cans like Altoids might bend under weight.
That's all there is to it.