Arduino as keyboard or mouse (No extra hardware) - Library

Hi all, I always see people posting in the forums wanting to use their arduinos as a keyboard or mouse, without extra hardware. After reading about the java robots class, I wrote a processing applet and arduino library that allow an arduino to send keystrokes, mouse clicks, and move the mouse on the computer over serial. Just include the library in your sketch, run the processing applet on the computer, and you're all set. Then you can call any one of the following functions from your arduino sketch:

mouseClick('L') mouseClick('R') for left or right mouse
keyStroke('A') A can be any character, but note that it will come out lowercase unless you keypress shift.
mouseMove(x,y) x and y are integer coordinates for where to move the mouse
specialKeyPress("KEY") "KEY" can be "SHIFT", "ALT", "CTRL", "UP", "DOWN", "LEFT" or "RIGHT"
specialKeyRelease("KEY") same as above, but releases key

Library can be downloaded here: http://www.filedropper.com/hidproxy . Place the unzipped folder in your libraries folder in sketchbook.

This is the processing sketch: http://www.filedropper.com/hidproxyprocessing . You may need to change the [ 1 ] in Serial.list to a [ 0 ] depending on whether you are using *nix or Windows.

Note: In order for this library to work you must include Serial.begin(115200); in your setup routine.

I hope someone finds this useful!

Hey very nice! I wonder if this works under directX games. Say if someone is playing a game and needs to switch weapon or spell or something just assign it to a button on arduino!

Thanks! It definitely would, as it simulateS key/mouse activity at the os level, which is why this is pretty useful (for me at least) . Using the arduino as a HID is beat because it lets you create custom physical interfaces for your computer, and thats what I hope this library will make easier.

Hi
Bilbo can you update the links please. I really want to test your library in a frets on fire project I’m working on. I hope the program will be able to read the keys sent by the arduino