My April Fools joke hit a roadblock when I discovered that my coworker was using an old PS2 keyboard rather than a USB one. I had to work out a solution for that. A bit of googling turned up this on the Arduino site: PS2Keyboard
. So basically I just needed to find a PS2 connector and to wire up an interrupt line and a data line and then the Arduino can read the PS2 key presses. I took the example library from PS2KeyboardExt2
since it was a bit more advanced than the PS2Keyboard library, and I modified it to map the PS2 key scancodes onto USB Keyboard HID Key Usage codes, and added a function to return a USB HID Keyboard Report.
It took a few hours to get the job done, tested with a USB to PS2 adaptor attached to my keyboard. Everything seems to be working except for NUMLOCK key changes but hopefully my coworker won't notice that.
Here's the PS2KeyboardUSB library files and the sketch:
The project could be used to make a nice PS2 to USB keyboard adaptor.
I installed the project on my coworker's docking station Friday morning (April 1st) while he was distracted by an accomplice. We're all waiting to see if he notices it or just slowly goes mad.