I recently made and published an instructable on a home made arcade machine using a raspberry pi as the brains. I had a couple of questions about the keyboard encoder that I used. Initially I had planned to write a program that would boot to a list with a selection of games to play and the user would use the joystick and buttons to toggle through the list and select a game.
This turned out to be a hell of a lot trickier than I first thought, mainly due to the fact that the keyboard encoder I bought wasn't spitting out any thing that I could easily read in Linux. So I decided to "build" an encoder that would.
Step 1: What You'll Need
Lots of different coloured wires
Soldering iron and solder (optional I'll explain later)
Some sand paper (150grit or higher is ideal but use whatever you have)
Multimeter (optional, but highly recomended, again will explain later)
General tools (screw driver, wire cutters, scissors etc.)
Step 2: What Is the Encoder
Step 3: Getting to the Encoder
Step 4: Mapping the Keys You Need
Inside the keyboard you'll also notice that there are two bits of plastic film that kind of look like a PCB separated by another bit of film (usually stuck to one of the others).
There should be dots and lines all over it and you'll need to identify which dots correspond to which keys. the easiest way to do this is to count. So the A key on my keyboard 4 down, 2 across (ESC being 1, 1). so get the position of the keys and then count the dots.
Then use a multimeter to find out where these keys joined up to the contacts. Set your multimeter to conductivity mode (set the beep if you can) place on of the terminals on the dot (say for the A key) and run the other terminal along the contacts until it beeps or acknowledges conductivity. Make a note of which contacts they are. I labeled mine 1 - 13 and A - N and just wrote it down. it also helps to mark out the keys with a marker so you don't forget any.
Step 5: Prepping the Encoder
place the tinned wire on top of the tinned contact and press the soldering iron on it gently, wait until the solder liquefies, remove the iron and hold the wire as steady as you can until id hardens again.
If you're not confident in soldering and don't want to do this you could always use conductive adhesive (eg. WireGel). But I reckon solder would be the better and quicker option as most contact adhesives need to cure overnight.
Step 6: Finished Product
In the case of mame up, down, left right for directional controls, Z,X,C,V can be used for buttons and Tab so you can get into options (you might also wanna put in a button for credits)
now all you need to do is hook it up to your buttons as you would a regular encoder. For more information on that you can look here at step 3.