3

我需要获取 Linux 操作系统上的输入设备列表。类似于解析 /proc/bus/input/devices 的东西,但我实际上不想重新发明轮子。我相信应该有一些系统功能来枚举设备和类似的东西。它是一个嵌入式 Linux,所以我可以使用的库有限。

4

2 回答 2

2

听起来你想要这个命令:

libinput list-devices
于 2020-07-22T22:31:10.313 回答
0

So, to find the mouse event handler, you search for a line that begins with "H:" and has a "mouseN" on it. It will then have a "eventM" on the same line. Should be doable with about half a dozen or so lines of code to open /proc/bus/input/devices, read a line, check if it's "H:" start, and if so, parse the rest of it for "mouse" and "event" bits.

于 2013-10-14T16:27:51.560 回答