1. Arduino Leonardo or Micro (The Leonardo and Micro Arduino boards can emulate keyboards and mouse commands, Uno and other boards can't.)
2. 4 light touch micro switches
3. Micro USB lead
4. 2.5 millimeters welding wire
5. Approximately 1 meter of six core wire
6. Soldering iron
7. 4 10k resisters
8. 72 millimeter x 200 millimeter x 1.5 millimeter aluminum sheet
9. Access to a 3-D printer.
Step 1: 3d Print buttons and case.
First step is 3-D printing the buttons and cases for the button box. There are 5 STL files you will need. Print one of each.
Step 2: Assembling the electronics.
The electronics are very simple; it consists of four micro switches, four 10k resisters, a meter or so of six-core wire. When one of the micro switches is clicked it will send 5 volts to a digital pin on the Arduino Leonardo. When that switch is released the 10k resistor is there to make sure to digital pin returns back to ground. (If you don’t have the resistor weird stuff can happen like that button not releasing properly.)
We just soldered the resisters from the ground pin to the digital pins we are going to use. A bit rough but it works. You will need to strip back the 6 core wire a fair bit to give you enough length to work with. One wire is used to supply the 5 volts to each switch; four wires also go to each switch. There will be a sixth wire we don’t use, best to keep it as spare so if one of the wires breaks you could replace it easily.
Step 3: Assemble Button Box.
Assembling the button box is pretty straightforward. I have included a exploded view so you can see exactly how it goes together.
Step 4: Upload Arduino code.
Upload Arduino code. Please note this will only work for the Arduino Leonardo and Micro.
buttonbox_up_down_left_right.ino this is for pressing the arrow keys. Caution make sure the keyboard press matches the keyboard release