Flipping through the Happ catalog the other day, I noticed that encoders went for $100+ dollars. Since I've been looking at (cheap) methods to hook up buttons and joysticks to a computer for when I build my MAME Cabinet, I believe that an encoder is the way to go for everything but analog controls. However, the price isn't right. Thinking about it, and tearing apart several non-working keyboards for more information, I believe I have come up with a (still untested) method of creating an encoder for the price of a cheap keyboard.

To make a keyboard encoder, take apart a (newer) cheap keyboard. There should be a small circuit board that attaches to the keyboard cable. The circuit is rather simple, a few capacitors, resistors, and diodes, plus a big chip that I am assuming is the keyboard decoder. The rest of the keyboard is two layers of plastic with conductive traces seperated by one layer of plastic without conductive traces. When a key is pressed down, it forces a trace on the top layer to contact a trace on the bottom layer through a hole in the insulating layer. The plastic "connects" to the circuit board by having one edge of the plastic, with the conductive traces, lay on the edge of the circuitboard. To build a custom encoder for the price of a cheap keyboard, all you need to do is recreate the encoder circuit board with that edge replaced with a method of connecting wires to the circuit board. To do this, first carefully unsolder the encoder chip from the original circuit board, as well as the capacitors, resistors, diodes, etc, (although, for the later, you can always cheaply replace them). Now you want to etch a new circuit board that is exactly like the original, except it has a terminal block(s0 to connect to. This is your cheap keyboard encoder.

To understand how it works, you must understand how the keyboard originally works. There are less then thirty connections to the encoder circuitboard. (Lets assume twenty-two for the sake of argument). If we divide the number of connections in half (eleven and eleven), we now have a 121 possibilities circuits that can be made by connecting one member of the first group of connections to a member of the second groups of connections. Since a standard keyboard is 104 keys, this is more then enough permutations for a standard keyboard. Imagine the first group of connectors as being labeled A-K, and the second group being labeled 1-11. G4 would be a conneciton between G and 4, which might correspond to the 'Shift' key. The combinations that define keys aren't in a logical order, it doesn't go A1 = 'Esc', A2 = 'F1', A3='F2', etc. The keys are laid out in a way to prevent key ghosting, which happens when three or more keys are pressed, and the computer thinks another key has also been pressed. For example, if the keys corresponding to A1, A2, and B1 have been pressed, a closed circuit for B2 has also been formed. The best way I've thought of to come up with the key combinations is to take the pieces of plastic that have the traces on them, photocopy them, and then trace each route with a colored marker. Then take the insulating layer of plastic, which has little holes in it, lay it over each copy, and mark the holes. Except for a few holes for screws/structural support, and maybe a few unused holes that correspond to different models, each hole is where a key is located. Through trial and error, one can guess what combinations lead to most keys. Then, its a simple task of downloading one of the few apps out there that tells what key is being pressed, and verifying your results.

Once you have done this, I recommend saving it as a file and keeping a printed copy with the custom encoder. To use with a button, just find the key you want to hook up the button to and then connect each wire to the corresponding connection. A joystick is slightly more complicated, a 4 way joystick will use four keys (one for each direction), and an 8 way joystick will use 8 keys. Analog controllers won't work, and thus cannot be connected, since all of a keyboard's connections are digital.

Of course, to use this with a regular keyboard, you must build a keyboard splitter, but that's another node.

Final notes:

This is an untested method. Try at your own risk. Some keyboards are different. YMMV. Any keyboard that "clicks" when the keys are pressed probably uses microswitches, thus this method may not work. If a keyboard has one or two malfunctioning keys, the encoder may still be good, and the keyboard can be salvaged for this task.

Here are a few tips from someone who has been there.

This is very difficult, more so than you would think. I would not use this method for any control panel having more than 1 joystick and 2 buttons. The ghosting and masking issues are much more difficult to get around than you would think.

Even a panel with only 2 joysticks and 2 buttons per player may take hours of trial and error to find a seemingly working combination. It is only later you will find some odd occurance like pressing down on player one, while player 2 presses a diagonal and a button causes some different press to be recorded. Normal gameplay causes a lot more simultaneous keypress than you would think, it is possible to hit 16 keys at the same time while playing Streetfighter 2 and even something simpler like Golden Axe has a possible 10 at once (both examples are for 2 players).

This method is great for wiring up your coin mechs and your emulator control buttons. As long as you don't plan on pressing more than one at once you will be ok.

If you are going to rip something apart for the encoder, try a Microsoft Sidewinder joystick. They are almost as cheap as a keyboard and have enough inputs to run a 2 player, 3 button panel. There are also several specialized Mame encoders that are cheaper than the ones from the Arcade manufacturers.

Finally I wanted to clear up a few errors in the above. 8 way joysticks do not take 8 keys, they only take 4 just like the 4 way ones do. The only physical difference between the two types of stick is that the little bit of plastic that hits the microswitches is shaped differently. Also, you do not have to create a brand new circuit board. It is much easier to wire the original one up to a terminal block.

Log in or register to write something here or to contact authors.