Sometimes, the mouse just isn't as convenient as it could be for clicking, dragging. Sometimes, your hands are just busy. One evening, while my wife was playing World of Warcraft, running from one town to another, she commented that it was difficult to do so while eating, and wouldn't it be nice if she could just steer with her feet?
First, I found a set of industrial pedals from the local surplus shop. I don't know what they were hooked up to, but they're all metal and I could probably jump up and down on them, drive them over with a truck, and they wouldn't be any the worse for wear. Perfect for a game where adrenaline runs high!
Second, I needed to hook them up to the computer. I could have torn open a keyboard and just wired into two individual keys, but I wanted to do be able to have three different possible key presses from two pedals. I'd do that in software. But the hardware decision still remained. Since I already had the software solution in mind (below), I knew I could just use a mouse. It has the advantage that it's small and easy to work with. Not all keyboards use common-ground switches with a PCB making it easy to solder to.
Find an old 3-button USB mouse (no scroll wheel; nobody could possibly want that!). First TEST it with the computer before proceeding. Crack open the mouse (easy; a few screws). The foot pedals had three wires coming out; one for ground, one for left, one for right. They were normally open (perfect!) and so with a multi meter I figured out which wire was in common with all three switches, and soldered the ground wire to that. Then I arbitrarily soldered to the left and middle buttons, since I would be mapping buttons to keyboard presses in software. For strain relief, I zip-tied the cables to some of the screw holes on the PCB. I double checked my work with a multimeter and then moved the whole setup upstairs to the computer.
OrderedBytes::ControllerMate is a Mac-only application that lets you remap any USB HID (Human Input Device; usually a keyboard or mouse) input through drag-and-drop logic to any virtual USB output. It lets you create state machines, key sequences, and even timing delays. For simple setups, it's free, and you pay a nominal shareware fee of $15 for full access.
The basic logic was simple enough: if pedal A and (not pedal B), send left arrow. If (not pedal A) and pedal B, send right arrow. If pedal A and pedal B, send up arrow. The thing that took me an hour or more to figure out is that I needed to turn the mouse "off" so that it wouldn't send its regular output to the computer. Obviously, the extra mouse button presses were not desired; I only wanted the mouse as a input to ControllerMate. That took me awhile to find, but everything worked perfectly after I found it!
Update 2024: Unfortunately, ControllerMate last functioned on macOS Sierra released in 2016. If you have a old mac, great, this will still work for you. If you have a newer Mac, well, too bad. I'm sad that it's dead; It was amazingly useful.
Press both pedals to run forward, press one to turn in that direction.
Rewire a mouse as an easy way to input simple switch closure into a computer. Remap the mouse inputs via ControllerMate to anything I want.