I've built a custom input device, similar to a one-handed keyboard, around the arduino. Now I'm trying to figure out how can I get the PC to recognize the arduino as a keyboard, and communicate keystrokes.
Right now I'm sending data over serial to an application on the PC, when then generates keyboard events. This approach is obviously not optimal, plus it doesn't work when DirectInput apps, etc, are running.
One idea that comes to mind is to hack an actual keyboard. Some use matrices where it scans all the buttons row by row and senses if any of the columns are connected. Maybe you could have the arduino put voltage to the columns when it senses voltage from the right row?
To the best of my knowledge, because of the hardware, the computer will only recognize the usb connection on the arduino as a serial link, not as a HID.
I think it would not be difficult for an Arduino to emulate a PS/2 keyboard output. If I recall correctly, this is a 0 - 5VDC serial interface.
You could then cut up a PS/2 keyboard cable (you should be able to find an extension cable) to get a cable with a male PS/2 (actually a DIN-style) plug.
I have previously used the hacked keyboard approach for other input devices, mainly arcade controllers which have only a few buttons/switches. The problem with that is that representing a standard 101 key keyboard requires a lot of pins (you'd have to control a 10x11 matrix at least). I'm sure there are clever ways to reduce the pin count, but I'm looking for a more direct approach.
Emulating a PS2 device looks interesting. I'll play around with the ps2dev library linked earlier.
I haven't seen any example of using an Arduino as a keyboard, but have seen several projects that use the various Atmel chips plugged into the USB port acting as a keyboard etc.
Do a search in Google for "AVR HID" (HID = Human Interface Device, which is the category keyboards belong to). It should return a number of examples, and you might be able to adapt the code from one of these, or turn your design into a standalone device rather than being an arduino.