时,我无法获取鼠标移动事件a>测试输入事件的工具。I can't get the mouse move event when using the evtest tools to test the input events .我只需要三个鼠标事件:I just get three mouse events:left click event: type = EV_KEY, code = 272 (LeftBtn), value=1/0right click event: type = EV_KEY, code = 273 (RightBtn), value = 1/0mouse wheel event: type = EV_REL, code = 8 (Wheel), value = -1 无鼠标移动事件。所以我的鼠标移动事件和如何捕获它?No mouse move event. So where my mouse move event and how to capture it? ps:测试在$ code Ubuntu 11.04 和 Gentoo 在VirtualBox-4中安装了virtualBox-addition。ps: Tested on Ubuntu 11.04 and Gentoo in VirtualBox-4 with virtualBox-addition installed.推荐答案如果没有嵌入式linux系统,我更喜欢使用 input-utils 工具,而不是 evtest (如果我在Android上,我使用 cat / proc / bus / input / devices 和 getevent )If not on an embedded linux system I prefer to use the input-utils tools rather than evtest (and if I'm on Android I use cat /proc/bus/input/devices and getevent )通过以下方式安装input-utils:Install input-utils via:$ sudo apt-get install input-utils列出我所有的输入设备$ sudo lsinput/dev/input/event0 bustype : BUS_HOST vendor : 0x0 product : 0x5 version : 0 name : "Lid Switch".... phys : "isa0060/serio1/input0" bits ev : EV_SYN EV_KEY EV_ABS/dev/input/event12 bustype : BUS_I8042 vendor : 0x2 product : 0xa version : 0 name : "TPPS/2 IBM TrackPoint" phys : "synaptics-pt/serio0/input0" bits ev : EV_SYN EV_KEY EV_REL然后我在笔记本电脑的追踪点上看到事件(不要忘了在开始输入事件之后移动它)Then I read events on my laptop's trackpoint (don't forget to move the it around after starting input-events)$ sudo input-events 12/dev/input/event12 bustype : BUS_I8042 vendor : 0x2 product : 0xa version : 0 name : "TPPS/2 IBM TrackPoint" phys : "synaptics-pt/serio0/input0" bits ev : EV_SYN EV_KEY EV_RELwaiting for events16:43:46.516075: EV_REL REL_Y -116:43:46.516090: EV_SYN code=0 value=016:43:46.539642: EV_REL REL_X -116:43:46.539656: EV_REL REL_Y -116:43:46.539660: EV_SYN code=0 value=016:43:46.704385: EV_REL REL_Y -116:43:46.704401: EV_SYN code=0 value=0 这篇关于无法从/ dev / input / event *获取鼠标移动事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-05 00:38