开源改变世界!!

How can I add different custom joystick configurations? #1596

推推 grbl 2年前 (2023-01-28) 134次浏览
打开
hmantz 打开了这个问题 2021 年 5 月 11 日 · 3条评论
打开

如何添加不同的自定义操纵杆配置?#1596

hmantz 打开了这个问题 2021 年 5 月 11 日 · 3条评论

注释

How can I add different custom joystick configurations? #1596

如何添加不同的自定义操纵杆配置?每次添加新代码时是否都必须编辑 gamecontrollerdb.txt 并重新编译整个代码?如果是,是否可以在设置目录中包含 gamecontrollerdb.txt(或其他一些文本配置文件)并能够使用文本编辑器对其进行编辑而无需重新编译?

谢谢

最初发布者@hmantz#1565(评论)

How can I add different custom joystick configurations? #1596
合作者

是的,您当前需要更改配置文件并重新编译软件。使配置更加动态是个不错的主意。

How can I add different custom joystick configurations? #1596
作者

知道何时可以实施此选项吗?

How can I add different custom joystick configurations? #1596
合作者

用于访问游戏手柄/操纵杆的 API 不允许动态配置。否则,读取 gamecontrollerdb.txt 并从 UGS 设置文件附加您的配置会很容易。

要实现此行为,您需要编写一个新的临时文件,然后加载该文件:
https ://github.com/winder/Universal-G-Code-Sender/blob/master/ugs-platform/ugs-platform-plugin-操纵杆/src/main/java/com/willwinder/ugs/nbp/joystick/service/JoystickServiceImpl.java#L94

我们正在使用该库的旧变体,较新的变体看起来有动态添加映射的选项:
https ://github.com/electronstudio/sdl2gdx
https://electronstudio.github.io/sdl2gdx/org/libsdl /SDL_GameController.html#addMapping-java.lang.String-

免费注册 在 GitHub 上加入此对话。已有帐户? 登录评论
标签
还没有
项目

还没有

发展

没有分支机构或拉取请求

2名参加者
How can I add different custom joystick configurations? #1596How can I add different custom joystick configurations? #1596

喜欢 (0)