Java中的虚拟操纵杆

您是否听说过具有Java包装的Windows虚拟操纵杆?

我正在尝试PPJOY,它工作得很好,但后来我需要使用JNI来使它从Java工作,而且暂时看起来并不容易。

谢谢!

你在这。 我为PPJoy制作了一个Java包装器。 它真的很容易使用。 看到:

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(); } 

源代码和二进制文件可以在这里找到。

我发现了这个:

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

虽然没有尝试过。 希望能帮助到你!