Making a game controller from an old USB keyboard

I’m not much of a gamer. I usually get bored with them easily, but in the madness of 2020 I purchased European Truck Simulator 2 and a Logitech G920 steering wheel and pedals. I enjoyed playing for a while but found there were not enough buttons on the controller for all functions. Some controls had to be accessed through the keyboard and I had trouble remembering what button to use for each function. I thought it would be fun to try and make a simple dashboard to go behind the steering wheel using button switches.

Rather than using a microcontroller I decided to use the module from an old USB keyboard as I already had a few old keyboards. The one I chose was probably an extremely cheap one. One benefit of that is that it doesn’t attempt to load manufacturer drivers or software. It just happily uses the generic windows drivers.

I pulled it apart to see what was inside. This one contained a small circuit board with all the smart bits inside a COB. The circuit board has a row of connectors that are held on to the two plastic membranes with a zebra strip.

Theseare the two membranes

And this is the small module. The smart bits are all under that COB. There are 3 LEDs on the ither side, for num lock and caps lock.

My idea was to place a bunch of momentary switches on a panel and wire them across the appropriate tracks on the keyboard circuit board. As I was planning on only using this for one game, I used the default keys for that game. Rather than figure out just the keys I planned to use I decided to try and work out what all combinations of track connections did. I discovered that there were some that were not available on the keyboard, for example the module supported a calculator button. In the end I made a table of the combinations. Even after testing it 3 times I’m not completely sure that I have it 100% correct. After starting I found this instructible Mapping the Innards of a Keyboard that I found very helpful. If you want to build something like this I recommend using that instructible. As I started before finding that article the table column and row numbers and letters I have used for the module connections are different.

The way I tested the combinations was to start by tracing the tracks from the two membranes back to the connectors. Then to check my results I opened Notepad++ and using a multimeter cable with a probe on both ends checked my results by shorting the connections on the module. The tracks are in two banks; one for the bottom membrane of button plastic and one for the top. It was just a matter of going through the combination of these two banks. I later found this site Javascript Key Event Test Script that shows info about keypresses which is helpful for those keys that are not for a number or a character.

Not all combinations gave an obvious result, but in the end it didn’t matter. I found there are other tables of combinations on the internet, but I presume there is not a standard that is followed so testing each one is probably required. This is the table I made from testing my module.

For buttons I used mostly illuminated momentary push button switches. I found some icons that I could use for symbols and printed these onto an overhead transparency sheet using a laser printer. These were cut out and put in the front of the switches. While it would be better to have the back light for a switch only illuminate when the function that it corresponded with is on, for example light when the truck handbrake is on, that is not possible with this setup, so the backlights were wired up across the USB power connections making them on all the time.

I notice that it is possible to buy these circuit boards from AliExpress USB Keyboard Chip IC Module HID Large Keyboard Can Be Used as Game Console, but they cost almost as much as a cheap keyboard, not that I recommend buying a keyboard for this. There are so many old keyboards around, most people wouldn’t have too much trouble getting an old one.

This is how it turned out. The steering wheel clamps onto the base.

Would I do it again? Probably not, even if I did play the game regularly, I would probably just get an old keyboard and stick labels over the keys and write the functions on them. While it functions as intended, I don’t think it was worth the work for my use and aesthetically I was fairly disappointed. However, maybe you can think of a use for a similar project that is worth it for yourself.

Leave a comment

Website Powered by WordPress.com.

Up ↑