Now let's work on the interface for the joystick/buttons. This is how the controls will communicate with the PC.



You can buy encoders pre-made and save a lot of time, or you can do it on the cheap and spend a lot of time soldering. I prefer to do as much as possible myself, without buying special parts.



Take apart the keyboard and inside you will find a thin transparent piece of plastic film. It's actually two pieces that you must separate. After doing so, take a sharpie and mark the contacts that correspond to the keys you want to use.



I used the following keys: tab, esc, ctrl, alt, R, F4, enter, num lock, and the numbers 2,4,5,6,8, all from the num pad, that is very important. The numbers across the top of the keyboard will not work. This is because I used 2,4,6, and 8 as the up, down, left and right controllers for the emulator. By turning on sticky keys, these same numbers control the mouse cursor. The num locks enables/disables sticky keys. The number 5 key is the left mouse click. If you are using an 8-way joystick, you can also use the numbers 7,9,1, and 3 for the respective diagonals. I chose to keep it simple with a 4-way joystick since it was only going to emulate and old school NES.



Inside the emulator, you can choose which keyboard keys control what. This is what I used:



Main buttons:



UP-------------------num pad 8

DOWN--------------num pad 2

LEFT----------------num pad 4

RIGHT--------------num pad 6

START--------------enter

SELECT------------tab

B button------------ctrl

A button------------alt



Secondary buttons:



Mouse Mode----------num lock

Reset-------------------ctrl+R

Hide/show menu----esc

Mouse click-----------num pad 5

Exit----------------------alt+F4



Now that you have keys marked on the films, we need to trace the contacts out and see which pin corresponds to which contact. each film will have its own set of pins. One set will be grounds and the others will be opens. The film that is the grounds will have the least amount of pins. My grounding film had 8 pins and the open film had 20 pins. For example: Take the R key on the ground sheet and using a multimeter in continuity mode, find out which pin of the 8 pins leads to the contact for the letter R. In my case it was pin 5. Doing the same thing for the letter R on the open field shows the R key corresponds to pin 11. Now we know that if we make those two pins touch each other, that will activate the letter R. That is how a keyboard works. Repeat this for every keyboard key you are going to use, making a list of this information as you go.



solder wires between the contact pins you need and a prototyping circuit board from radioshack. A nice tip is once you have your solder point done, smother the entire thing in hot glue so no wire accidentally get pulled off.



Once the interface is complete, you will wire the buttons to the prototyping boards.

