One way to do it is to pull the electronics out of a thrift-store USB keyboard and have the Arduino control switches across the desired keys of the keyboard matrix.
So since I don't own the arduino (wanted to check first if it is possible to make my project) - could someone tell me if this would work with arduino?
final int CAPS_LOCK = 20;
final int NUM_LOCK = 144;
final int SCROLL_LOCK = 145;
Robot r;
void setup()
{
size(100,100);
try{
r = new Robot();
}catch(AWTException a){}
}
void draw()
{
int v = (int)random(3);
switch(v){
case 0:
r.keyPress(CAPS_LOCK);
r.keyRelease(CAPS_LOCK);
break;
case 1:
r.keyPress(NUM_LOCK);
r.keyRelease(NUM_LOCK);
break;
case 2:
r.keyPress(SCROLL_LOCK);
r.keyRelease(SCROLL_LOCK);
break;
}
}
Another solution is to reprogram the USB port of the UNO to make the UNO behave as a Keyboard - http://hunt.net.nz/users/darran/ You can find him on the forum too.