您可以对游戏手柄上的按钮进行编程以与鼠标/键盘输入绑定吗? [英] Can you program buttons on a gamepad to bind with mouse/keyboard input?

查看:244
本文介绍了您可以对游戏手柄上的按钮进行编程以与鼠标/键盘输入绑定吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,是否有一种方法可以编写一个程序,该程序可以将游戏板上的按钮绑定到某些鼠标/键盘输入.例如,在游戏板上移动模拟摇杆以移动鼠标,然后单击游戏板上的某些按钮==按下键盘键或单击鼠标.哪种语言可以做到这一点?

I was wondering if there was a way to write a program that could bind buttons on a gamepad to certain mouse/keyboard inputs. For example moving an analog stick on the gamepad to move the mouse, and clicking certain buttons on the gamepad == pressing keyboard keys or mouse clicks. Which language would be able to do this?

推荐答案

当然可以.您只需要某种操纵杆界面,即可读取其动作,然后程序可以将其转换为发送给系统的其他动作.

Sure, its possible. You just need some sort of Joystick interface that allows you to read its actions and then your program can translate it into other actions sent to the system.

例如,在Java中,您可以使用 Jinput 来读取操纵杆,然后使用 jawa.awt.Robot 进行移动鼠标.例如,您可能需要使用一些移动控件,例如二次梯度来加快/减慢鼠标在一个方向上的按动时间.

For example, in Java, you can use Jinput to read the joystick and then use jawa.awt.Robot to move the mouse. You may want to use some movement controls, such as a quadratic gradient to speedup/slowdown the mouse movements the longer the joystick is pushed in one direction, for instance.

这篇关于您可以对游戏手柄上的按钮进行编程以与鼠标/键盘输入绑定吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆