Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 C/C++ 以编程方式在 Linux 中启用和禁用鼠标。X11 的输入扩展允许您使用终端命令执行此操作:
xinput set-int-prop "<device name>" "Device Enabled" 8 0
这非常有效,但我希望直接使用库来做到这一点。我在 libxi(X11 输入扩展库)上找不到任何合适的文档,并且 /usr/include/X11 中的头文件也没有提供任何有用的功能。谁能帮我这个?
你确实意识到这xinput是开源的,对吧?:)这是源代码树。
xinput
似乎可以归结为对XIChangeProperty().
XIChangeProperty()
您可能可以比我更仔细地阅读代码,当然还有手册页,以找出所需的参数。