2023-01-19 295
您是否听说过带有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();
}
可以找到源代码和二进制文件在这里.
我发现了这个:
尚未尝试.希望它有帮助!
以上所述是小编给大家介绍的Java中的虚拟操纵杆,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!
原文链接:https://77isp.com/post/25908.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态