Step 3Control interfacing : Keyboard Hack
MAME use different keyboard key codes to control the game: for example you get Fire1 by pressing the Ctrl key. So basically what I did is substitute some keys of the keyboard with original arcade pushbuttons. This method is called Keyboard Hack.
You need, on top the sticks and pushbuttons, a standard PC keyboard (PS2 connector) that you take apart to take is circuit board (called encoder). A keyboard encoder is made of different electric contacts separated in 2 groups (let's call them X and Y) and by randomly connecting contacts from the group X and the group Y using all the possible combination, you get the desired key code.
The key codes used by MAME are (by default, see attached screen-shot):
Player 1
- Up: Arrow Up
- Down: Arrow Down
- Left: Arrow Left
- Right: Arrow Right
- Fire 1: Left Ctrl
- Fire 2: Left Alt
- Fire 3: Space
- Fire 4: Left Shift
- Fire 5: Z
- Fire 6: X
- Up: R
- Down: F
- Left: D
- Right: G
- Fire 1: A
- Fire 2: S
- Fire 3: Q
- Fire 4: W
- Fire 5: n/a
- Fire 6: n/a
- Start 1: 1
- Start 2: 2
- Coin 1: 5
- Coin 2: 6
For example, on my encoder - each encoder is different - if I connect the contact 4 of the group X and the contact 11 of the group Y, I get the key code R (the key R in MAME stands for player 2 up).
Once you studiously wrote down in a table all the necessary combination in order to generate each key codes used by MAME (see attached image with a table for my example) , you can solder small wires on each contacts X and Y of the encoders to each microswitch contact from the pushbuttons and joysticks.
I would say this step is time consuming and can only be successfully achieved with careful planning.
However, the Keyboard Hack method I just described is obsolete (but is the most fun!). There are now on the market commercial programmable keyboard encoders, (such as the Ultimarc I-PAC) which allow to simply connect without any soldering iron all the pushbuttons and joysticks to the PS2 connector of the motherboard.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|

















































