The main parts of a PC keyboard are the keyboard controller and
the contacts for each key.
There are 2 sets of wires for the contacts, forming a matrix.
The contacts are connected to one wire from each set. When a
contact is presesd, the circuit is completed between the two
wires. The keyboard I hacked had 16 wires in one set and 8
in the other, giving a maximum of 16x8 = 128 keys.
The controller checks for key presses by passing current
through each wire in the first set, in turn, and seeing which
wires in the second set have current. It then translates the
info into something the PC can understand. The limit to
the number and combination of keys that can be held down
together comes from the controller.
|
The 'keyboard hack' involves removing the controller from
the keyboard and wiring up the cabinet controls to your own
matrix. The keyboard I used was an old IBM ps/2 model. I had
several of them sitting in boxes in the garage, so there
were plenty of backups in case I killed one. Inside the
keyboard, the matrix was printed on 2 sheets of plastic.
The contacts were seperated by a third sheet. The controller
was on a small PCB, hidden underneath a sheet of metal
supporting the matrix.
|
|
I mounted the controller together with a hobby PCB to
make it easier to work with. The first photo below shows
the state of the controller before I started working on
it. The three black connectors on the top, from left to
right are for the 1st set of 16 wires, the 2nd set of 8
wires and the keyboard LEDs. The LEDs are still plugged
in at this stage and you can just make out the tracks
on the plastic that connect them to the controller. In
the second photo, I've removed the connectors and wired
the controller to the hobby PCB with some old floppy-drive
ribbon cable. It took a while to solder all the wires in
place, but it made the rest of the work easier.
I placed the controller between player 2's controls and
the cabinet controls. The mounting is hinged, and swings
open, for easy access. The next job was to find out
where the necessary keys were on the matrix. To do this,
I connected the controller to an old 386 running the
same program I used to wire up player 1's controls. The
386 was used instead of the cabinet's PC as it's fairly
easy to blow up the controller and/or the keyboard
interface on the PC. The matrix I came up with is shown
below. It's actually using MAME's standard settings for
player 1, as the player 2 standard key assignments have
always caused problems when multiple keys are being held
down. The 5, 1 & 2 keys are used for the coin-mech,
1up and 2up respectively.
This is the final result. If you look carefully, you
can see that the ribbon cable for the set of 16 wires
in the matrix is now wired underneatch the PCB. I had
to replace the keyboard controller as it broke sometime
when I was either fitting or testing it (oops!). The
keyboard LEDs for Num-lock and Caps-lock are wired
to the 1up and 2up buttons on the front panel. The
buttons light up when enough credits are inserted in
some games.