How to Hack a

By eweek  |  Posted 2004-06-14 Print this article Print

Keyboard"> You may be thinking, based on the previous sections information about how keyboards work, that it should be possible to substitute arcade controls in place of keyboard buttons. In fact, it is, and many people have done just that. With the low cost of keyboards (sometimes with rebates you can even get them for free) and the high number of inputs available, a keyboard hack sounds ideal. It is possible to successfully use a keyboard hack, but there are several obstacles to overcome first. Because of the potential drawbacks, I strongly recommend reading this section completely before beginning work. There are alternatives available if you decide a keyboard hack is not for you. Caution
Warning! The rest of the discussion on keyboard hacking can prove hazardous to the health of your computer! There is a +5v presence on the encoder board while connected to the computer. If something goes wrong, it is possible to fry the keyboard port on the computer or the motherboard itself. With care this can be avoided. However, if you are concerned, you may wish to skip ahead to the last section in this chapter covering commercial encoders.
Mapping the matrix Your first hurdle will be a time-consuming one. Because every keyboard is different, you will have to manually determine the matrix your keyboard uses. Im assuming youve taken apart your sacrificial keyboard and disconnected the keyboard encoder board from the rest of it. The procedure is simple. First you need a program on your computer that will tell you what keystrokes are being generated. Its easy to tell when letters and numbers are being pressed with any word processor or notepad application. However, those wont tell you if youre pressing the left shift key, right control key, etc. On the download section of the Build Your Own Arcade Controls Web site ( there are several utilities that will do just that. Download one of them and fire it up. On the CD-ROM Ghostkeys 1.1 (by John Dickson) is one of the programs that will tell you what keystroke is being generated, and is included on the companion CD. Start by laying out a grid on a piece of paper matching the X and Y contacts on your keyboard encoder. Next, take a length of wire and strip off ¼ inch from both ends. Hold (or attach with an alligator clamp) one end of the wire to the first X contact. Then, hold the other end of the wire to the first Y contact and observe the keystroke that is generated on the computer. Record it on your grid, and move on to the second Y contact. When youre done with all the X1 combinations, move on to X2 and repeat. Continue until you have the entire matrix laid out. This can be quite time-consuming! After mapping the matrix out, you need to decide which keystrokes youre going to use for your control panel. You need to consider two factors. First, you need to determine what keystrokes are required by the software you decide to use. Many games are programmable—that is, they allow you to choose what keystrokes perform the in-game functions. Some, however, have hard-coded keystrokes for game control and do not allow changing them. For instance, the fire key in a particular game may be the "F" key. Even though all your other games use the left control key to fire, you have to use the "F" in this one. Second, you need to look at how your keyboard encoders matrix is laid out. Certain keystroke combinations will be precluded from use simply due to where they are on the matrix. The next section, Difficulties with keyboard hacks, will cover this. After you map out your keyboard matrix and choose the keystrokes you need, you can begin to wire things up. Take another look at the keyboard encoder from our example in Figure 8-3. The contacts on the edge of the encoder cannot be soldered to, and theres no easy other way to attach your wiring to them. Follow the path of the circuits back a bit to see where they connect up to solder points. That is where you can solder your own wiring to. The best way to proceed is to strip a small amount off both ends of the wire, pre-tin one tip with solder, and solder it to the contact point. Next, take the other end of the wire, crimp a connector on it, and attach it to a wiring block a few inches away, as shown in Figure 8-6. Repeat with the rest of the contacts. It is easiest to solder all the wires first and then attach them to the wiring block. The advantage of doing it this way is that any modifications are done to the wiring block, and not to the wiring between the keyboard encoder and the block. This helps to ensure the wiring to the encoder is not damaged. You dont want to have to re-solder it!


Submit a Comment

Loading Comments...
Manage your Newsletters: Login   Register My Newsletters

Rocket Fuel