c++ - Linux 中 XInput* 函数的等价物是什么?

标签 c++ c linux xinput

我正在将一个使用 Xbox Controller 的应用程序移植到 Linux。在 Windows 上,它基本上只是使用 XInputGetState() 来读取 Controller 的状态,所以我正在寻找 Linux 上该功能的替代品。

我看到了 wine hasn't implemented XInputGetState() , 但同时在 Linux 上有大量的游戏支持 Xbox Controller ,所以这是可行的。

有人知道什么库可以用来与 Linux 上的 Xbox Controller 交互吗?

最佳答案

您可以:

  1. 使用SDL library
  2. 自己使用linux/joystick.h中的函数
  3. 找到一些其他的库,它为你抽象 (3) this或用户 3716731 链接的那个。

(1-2)的解决方案主要是C,但是XInput API也是,所以你应该可以处理它。

我可能会选择第 1 种方法,因为这种方法应该有最好的文档。

关于c++ - Linux 中 XInput* 函数的等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35189264/

相关文章:

c++ - std::is_base_of 的 VC2010 实现包含一个错误?

python - 将 shellcode 发送到 Windows 中的交互式 C 程序

c - 增加 ARM i.MX287 上的 Linux DMA_ZONE 内存

linux - 批量重命名长文件名

linux - 比较两个文件 diff awk else

linux - 编译时 Ubuntu 14.04 中的 Oracle Developer Studio : Cannot find sys/cdefs. h

c++ - 关于 CMake 错误 : No source given to target 的问题

c# - 使用 CLR 编译的 native DLL,我是否必须先公开函数才能使用它们?

c++ - 在C++中存储未知大小的表

Visual Studio 2013 的 scanf_s 和 printf 中的 C 计算器错误