I use Arduino Uno to connect a (genuine) SNES controller to my computer via USB or Bluetooth.
Arduino captures controller buttons and releases using the snespad library . It conveys button presses and releases in the form of characters (for example, βaβ for pressing A, βAβ for releasing βAβ). The Java program then listens for serial output using the rxtx library . Finally, the Java robot simulates keystrokes using keyPress and keyRelease .
Unfortunately, this approach has several drawbacks. The main problem is key mapping. I kind of arbitrarily decided which buttons would be keyboard keys.
There is no KeyEvents game panel in Java. When I say "KeyEvent game panel", I mean something like the Android SDK: http://developer.android.com/reference/android/view/KeyEvent.html (ctrl + f "game panel" or "button ".)
My question is, is there a way to simulate clicking a mouse button instead of keys using the Java robot class?
source share