Virtual Joystick in Java

Have you heard about the virtual joystick for Windows with Java shells?

I'm trying to use PPJOY and it works fine, but then I will need to use JNI to get it to work with Java, and so far it doesn't seem easy.

Thanks!

+7
source share
2 answers

Here you. I made a Java shell for PPJoy. And it is really easy to use. Cm:

try { /* * Try to create a new joystick. */ Joystick joystick = new Joystick(); try { /* * Set joystick values */ /* * Set analog values for Axis X/Y/Z, * Rotation X/Y/Z, Slider, Dial. Overall 8 axes. * * Here we set the Z Axis to maximum. */ joystick.analog[Joystick.ANALOG_AXIS_Z] = Joystick.ANALOG_MAX; /* * Set digital values for the buttons. Overall 16 buttons. * * Here we turn on the 13-th button */ joystick.digital[12] = Joystick.DIGITAL_ON; /* * Send the data to the joystick. Keep in mind, * that the send method may throw a JoystickException */ joystick.send(); } finally { joystick.close(); } } catch (JoystickException e) { e.printStackTrace(); } 

Source code and binaries can be found here .

+6
source

I found this:

http://www.hardcode.de/jxinput/

I have not tried it yet. Hope this helps!

+1
source

All Articles