Building a pad

I am well known to computers (Ok ok, they are well known to me), and I have some understanding of electonics (though not much). Also know some programming.
What I wonder is how easily one can bild, connect, and program a with five buttons that simulates the lettesr z,x,c,v,b beeing pressed? It has to foll Windows into acceping the keystrokes in any porgram, not just the one I write, like a background application.
The intent is to give myself something to work on and try, to bulid a controlpad for the well known program WinAmp. Just to see if I can, and in the process, giving me even more understanding of computers, electronics etc.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

RoadWarriorConnect With a Mentor Commented:
Well this takes some of the fun away because it does most of the tricky work for you, it is a driver/adapter project that uses many available console game pads, and has drivers that EMULATE KEY STROKES in dos and in win 95. The Atari 2600 stick that the project supports is a basic 5 switch digital stick that would be easy to make a keypad version of, so that covers your 5 key requirement. Though the driver supports combos, so you could get extra functions using the fire button as a "shift" for 8 keys.

An atari stick uses 5 bits and a ground for a parallel interface, so you can rig up diode matrices to give you 32 different output values, don't know if the driver will support assigning a key to all 32 though (would be fun to build a pair for 10 bits and make a 10 fingered keyboard, hold down the ascii values you wanna type!) Anyhow, the data lines on the stick are 2,3,4,6 and 8, the return is pin 5, power is on pin 1 but shouldn't be necessary. I am not sure now the order of the data lines, but it should be easy enough to figure, I think pin 8 is the fire button though. I used to build this sort of thing for the Kempston interface on my Sinclair Spectrum (Timex 2000) but it seems a long time ago now.

So, the main page for this project is at ....
as you can see it began as a support for SNES joysticks.
You will probably get more out of the manual at...
which has the details for wiring the various gamepads to the PC and how the drivers are used.

The driver package itself is downloadable from a link on the top of the main page,


Road Warrior

The easy way to do it is to get a keyboard and rebuild it's electronics into a smaller case, then wire up the right rows and columns for the keys you want.

The hard way to do it is to learn about digital electronics, microcontrollers, maybe 80c51 assembly language, and blowing Eproms. This is not a bird project, it daunts the experienced hobbyist.

The difficult bit for both is making the keyboard work in parallel with your pad, making sure they are both synchronised with the computer, or one will lock up the other. Possibly the easiest way round is to get 2 identical keyboards, one to rebuild and one to use with it. Then the timing is the same on both, if you are lucky they sync the same at power on.

To learn more about interfacing the PC keyboard, look here.....

Actually since I last looked that link has gained some info on using PICs which are easier to play with than 80c51s, think those are for reading it, not emulating it, mostly though.

this link gives a good overview of the signals output by the keyboard and protocols it uses...
see sections 3.26 and 3.27 (right at the bottom)


Road Warrior

That's a pretty tough project for a first timer.  You've got both hardware and software issues that are non-trivial.

First, you can either hook into the keyboard port on the computer which is not exactly simple as you must be transparent most of the time but do the right thing when your keypad is active.  Alternatively, you could use the serial or parallel port to drive your keypad (and this is a lot easier since you can design your own protocol) but then you have a software problem.

If your keypad doesn't use the standard keyboard interface, you must write a device driver to hook it in to the keyboard driver.  This is a non-trivial activity and probably way beyond what I'd suggest for a beginner.
I think I have seen a joystick driver that can be programmed to emulate keystrokes in win 95, that would make things easy. Am looking for it.
Oooops, like I said, it was a long time ago, I found a diagram of a 2600 joystick, the thing is though that it makes the connection details for SNESkey look a little suspect, however, here it is...


Road Warrior
All Courses

From novice to tech pro — start learning today.