Hacking a USB Keyboard

Hacking a USB Keyboard
How to hack a USB keyboard or any keyboard for that matter. Send inputs into the computer without a pesky microcontroller.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Open up the keyboard

Open up the keyboard
Open up the case. You can use a screwdriver or an any ridiculous looking multi-purpose tool. Sometimes even after all the screws are removed the keyboard still won't open up. In this situation, don't worry, just forcefully pry the case apart with your screwdriver. It doesn't matter if you break the case. You don't really need it.
« Previous StepDownload PDFView All StepsNext Step »
159 comments
1-40 of 159next »
Feb 7, 2012. 9:31 AMtedino says:
Hi!
That video u mentioned on http://a.parsons.edu/~randy/video/typewriter.mov is down due of Inactivity. Please send new video and url please.

This was good tutorial :) i wanna see that video and i wanna try making own version of Typewriter perhaps :) Need motivation and wanna see that video :)
/ted
Oct 29, 2011. 2:07 PMcspoelstra says:
Thanx man, I was wondering for a wile to make such a thing as a cheap replacement for a midi controller for my DJ setup.. How about the switches you can use, is there an resistance problem ?
Aug 26, 2011. 5:38 PMvikingberserker says:
BRILLIANT!! Thank you, you have no idea how much this one helped me!
Jun 8, 2011. 7:33 AMthomkrauss says:
So another question...
Basically I'm using this hack to control an electronic drum set that I'm trying to make using the alphabet characters as triggers. The program I'm going to use seems to allow simultaneous hits.
My question: How do I wire it so that one button will trigger two different letters at the same time? My thinking is that if I wire two letters together, the board will be confused, this sending the wrong signal or no signal at all.
Can anyone explain what should happen? I'd like to address this before I try to build this and see that it doesn't work.
Thanks!
Jun 18, 2011. 5:28 AMpoita says:
Thank's dude that's an awesome instructable. I just found this site and haven't joined for full access yet so I copied andpasted it all into ms word.

I use a music playing program on my pc called 'HappyEO'. It let's me press mulitple keys at the same time to play chords etc.
On a related note. When I the program on some computers I get a delay when i press a key. I was using it on my 7 year old computer running XP and it was instant. When i installed it on my friends pc with windows 7 I got the delay from when I pressed a key to hearing the note. same on laptops running Vista and recently on a laptop runnin XP. Do you think it's something to do with the secrurity software that might be on the pc's?
Jun 8, 2011. 7:15 PMthomkrauss says:
Well I got lucky! I was able to tweak the free program that I'm going to use to produce the drum sounds. I was able to record the sound of the kick and crash together on a free audio recording program and then save as a wav file and map a keyboard character to that new recorded sound. I'll then just connect my button to that new letter.
Thanks for giving me the need to keep looking for an answer!
Jun 2, 2011. 6:37 AMthomkrauss says:
Is it safe to say that I should only use each pin once, to keep the wires and the board free of excess solder? I'm trying to use this method to build a set of drum triggers, an entire kit of drum pads, and want to know how many inputs I would end up with. The more I can get the better, I just want to see how limited I would be. I guess I could use two keyboards if it really came down to it.
Also, will a piezo attached to these pins work and will it produce two "keystrokes" for each hit as I've seen mentioned?
Thanks for the great instructions, and thanks to all who contribute and answer all the questions out here.
Jun 2, 2011. 11:12 AMthomkrauss says:
ok then my next question: if I were to connect multiple female RCA jacks to 2 pins on the board (to enable the "shorted connection" and "type letters") and then at the other end took a button and connected that to a female RCA jack and used male to male RCA cords to connect the junction boxes I make, will pushing the button make a connection and "type letters" or is there too much wiring going on?
May 12, 2011. 8:33 PMsmoak says:
I'm trying to put this into a custom controller. Simply using 12 keys, random if need be. Which side is side A and which is side B. My guess is that the top layer is side A and bottom later is side B. Would I be right to assume this? I'm hoping it would save me the trouble of having to trace, I have terrible eyes.
Apr 4, 2011. 9:11 PMdimitrisa10 says:
what will happen if you connect three pins will it display 2 characters because i'm making a hand-top out of a pico itx board and im wondering if i can use this to make a thumb keyboard
Apr 7, 2011. 8:23 PMdimitrisa10 says:
thx for the info do you think it would work though for a tiny keyboard
Jan 5, 2011. 6:01 PMcurrently_awake says:
keyboards send two scan codes for each key hit. One for each key press, a second for the key release. (the second has a bit set to mark it as a release). All the keys on the keyboard work this way, even shift and control.
Oct 21, 2010. 12:47 PMsnag46ed says:
Great Instructable! I'm a little confused though. So all we need to do is wrap the wire around to the corresponding pins and GLUE them down, or SOLDER, or does it matter?

Also, I'm trying to build one with one simple function...I want to make a big "Easy" button, or something like an "Easy" button send a space bar input. Would I follow the steps in this instructable, connect the "free" side of the wires from the modded keyboard controller to a prototype breadboard, and connect the leads of the Easy button to the breadboard where the wires from the keyboard connect?

So basically keyboard controller -> Prototype breadboard <-Easy button...?

Thanks so much!
Oct 21, 2010. 12:48 PMsnag46ed says:
I'm kind of a noob when it comes to hacking electronics, fyi :)
Sep 6, 2010. 3:18 PMthealeks says:
very nice instructable! im about half way thru hacking a keyboard of my own and this has helped me immensly! my hack is a little different tho. ill post an instructable soon!
Jun 25, 2010. 6:36 PMcapth00k says:
I tried to make this hack work with an old PS2 keyboard I had laying around -- to paint the keys on it and use as a synth controller on my mac - even got the PS2 to USB wiring worked out but it lights up and doesn't allow me to input characters ; nor is is recognized as a USB keyboard. I think there may be a USB device controller that PS2 boards doesn't have ; so perhaps changing the first page 'USB or (any) keyboard can be converted' should be changed if there isn't any way to make a PS2 one work. Here's the controller I pulled out of the old PS2 dell quietkey : The PCB is 123452 REV J ; the large IC has the following markings: nmbk15r4286 std5a8d bh 124200-002
Sep 3, 2010. 7:05 AMLee Wilkerson says:
You are absolutely right about the USB device controller. All USB devices have controller chips - that's how the OS recognizes that a USB device has been connected. ~/Lee
Aug 25, 2010. 6:18 PMI MAKE STUFF says:
another use of this is to add switches to flight sims such as fsx, fs2004 ect.
Aug 5, 2010. 6:09 AMjibatsu says:
on my keyboard, multiple keys are on the same pin e.g. the left key and the enter key, do i solder double wires onto the pins to connect to 2 keys. will they both work independently?
Aug 5, 2010. 8:54 AMjibatsu says:
so i only have 1 wire to each contact. amirite?
Aug 5, 2010. 9:00 AMjibatsu says:
all i need is L shift, S, enter, left, up ,down, num enter, num +, num - i followed the tacks back to the pins and marked them, how do i then wire it up as i have more buttons than pins.
Aug 3, 2010. 9:18 AMKarateLover21 says:
I am hoping to make a controller for scratch. I am making arrow keys, ZXCV and space.
Mar 1, 2010. 4:13 AMDackMilk says:
HOW ARE THE "ALT" AND "SHIFT" KEYS IMPLEMENTED?  THESE SIGNALS ARE NOT SEEN BY MY COMPUTER IN ANY WAY BUT PRESSING THE GOD DAMN SHEETS OF PLASTIC TOGETHER!!!
Jul 22, 2010. 2:44 PMFuingurth says:
well apparently, the CAPS LOCK key IS recognized
Aug 13, 2008. 5:52 AMelectronic boy says:
i have a usb keyboard and have tried to solder wires on but the contacts are like half a millimeter apart i am using a 12 watt soldering iron and i am neat at soldering
Jun 30, 2010. 8:02 PMMadrias357 says:
Try using just a little less solder. I've found that to be very useful.
Jul 4, 2010. 7:46 AMelectronic boy says:
Thank,s it worked very well and i went on to mod a wireless one and made a controller
Mar 30, 2010. 12:17 PMhacker3455 says:
 Is there any visual way to tell if you fried your keyboard PCB?
Mar 31, 2010. 10:10 PMhacker3455 says:
well i know thats not working, just wondering any dis-coloration in the board or something to that extent that would be an indicator. Guess i need to get a cooler soldering iron and a new keyboard.
Feb 18, 2010. 12:54 PMxM4ST3R SHAKEx says:
is that the way you read the pins on side b? right to left?
Jan 25, 2010. 4:37 AMdenis10k says:
A very easy way to find out which pin goes to which button:
Put one of the layers on a image scanner, scan it and fill the lines with different colors using the fill tool. Took me only 30 minutes to get the entire pin layout
Dec 22, 2009. 11:25 AMJavin007 says:
Insane.  I had absolutely no idea that a keyboard's guts were so simplistic.  I've created numerous toys/devices and have always been lacking for a way to design my own input method that didn't involve some complex crap with an arduino<sp?> device or something. 

My latest attempt was going to be a large MAME machine, but I was scratching my head on just how to deal with the inputs.  Trying to stick a full-blown keyboard into the device just to have the buttons press the keys seemed a bit hacky at best.  This is awesome.  Now I'm just TRYING to figure out what all I want to make with my extra keyboards.  I even have some wireless keyboards that I could see using to do some fun stuff with. 
Oct 16, 2009. 8:56 PMratgod says:
I've had a similar idea, I was going to use an old PS/2 style keyboard as an arcade joystick interface, I have the board out and mapped the keys (I shorted the sequences while plugged into an old laptop, but your way seems much better).
I was going to build a MAME cabinet using it, but never got round to it.

very good instructable.
1-40 of 159next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1971
Followers
180
Author:randofo(Randy Sarafan loves you!)
I am the author of the book '62 Projects to Make with a Dead Computer' and Community Manager here at Instructables. I'm always sharing tons of awesome projects. Subscribing to me = fun and excitement!