I'm writing on an application that gets signals of the Apple Remote and I'm already finished reading the hardware inputs on the remote. Now i have to replicate these inputs on the remote on something like an keyboard buffer or whatever there exists. I noticed a Java class in java.awt.Robot, but the commands are just send to the Java application itself and not system-wide (!), please correct me if i'm wrong.
But I need a solution to let my program virtually press the keyboard system-wide e.g. to support a pageflip with the arrow keys in a simultaneously launched program like MS Powerpoint.
Any suggestions?
Not working example of my Robot "Robert" (as I'm from Germany) that shall pass the pressed buttons system wide instead of application-wide.
switch(line) {
case LEFT: System.out.println("left");
robert.keyPress(37);
robert.keyRelease(37);
break;
case RIGHT: System.out.println("right");
robert.keyPress(39);
robert.keyRelease(39);
break;
case UP: System.out.println("up");
robert.keyPress(38);
robert.keyRelease(38);
break;
case DOWN: System.out.println("down");
robert.keyPress(38);
robert.keyRelease(38);
break;
case PLAYPAUSE: System.out.println("play pause");
robert.keyPress(516); // dollar sign
robert.keyRelease(516);
break;
case MENU: System.out.println("menu");
robert.keyPress(515); // euro sign
robert.keyRelease(515);
break;
}