Mapping a button press on Arduino to a keyboard key on PC

Hey everyone.

I want to have a button attached to my arduino, and when I press this button, have it work like a HID keyboard key.

I was thinking of using Processing, over a serial connection, but i've never tried it before.

It's just a temporary solution. (until I solder the button to a PS3 controller, for PS3/PC use)

I tried a few things tonight.

Setting the arduino to send a letter over a serial connection on a button press works.

I tried a program called Keyinjector, but it was a trial and I couldn't make use of it. There were a couple others I tried, and although they output that same letter in Notepad, it isn't detected in-game as a keyboard button press that is mappable.

Anyone know of a solution? A virtual HID keyboard program that converts serial-in data to keystrokes would be perfect.

P.S.- I'm using this to setup a handbrake for a racing sim setup i'm building. Here's a picture of my prototype setup as of tonight. Monitor needs a better mount, table needs angled front legs, and I need to make a mount for the TM1638 display. When the rest of my displays come in, i'll mount those up.

Guessing by your picture, your building an E-brake for a PC based Drift game....It looks cool. I have built something similar to what you are trying to do, but I wrote a C program on the PC side to communicate with the Arduino through a serial port to accept the the movements of a joystick. I dont think you would need a Arduino to accomplish what you are trying to do. If you have an old Flight Sim joystick that you dont care about, rip out the potentiometers and the controller. Hookup one of the potentiometers to your EBrake so it will be variable (the more you pull, the more brake you get) and plug the USB cable to your PC and it should see it as a HID device and your game may recognize it for input.

good luck..

bigD: Guessing by your picture, your building an E-brake for a PC based Drift game....It looks cool. I have built something similar to what you are trying to do, but I wrote a C program on the PC side to communicate with the Arduino through a serial port to accept the the movements of a joystick. I dont think you would need a Arduino to accomplish what you are trying to do. If you have an old Flight Sim joystick that you dont care about, rip out the potentiometers and the controller. Hookup one of the potentiometers to your EBrake so it will be variable (the more you pull, the more brake you get) and plug the USB cable to your PC and it should see it as a HID device and your game may recognize it for input.

good luck..

I ended up using this setup: http://blog.flipwork.nl/?x=entry:entry100224-003937

It emulates a HID keyboard, with 4 keys. Works perfect for the ebrake, as it can be used in ANY game and on ANY computer without additional config (except for mapping the key in-game).

I've still got to figure out a solution for the PS3 though. I've heard the PS3 is compatible with some HID gamepads, but i've yet to find out which ones these are.