无法从 /dev/input/event* 获取鼠标移动事件

发布于 2024-11-06 04:16:03 字数 539 浏览 4 评论 0原文

使用 evtest 工具时,我无法获取鼠标移动事件测试输入事件。

我只收到三个鼠标事件:

left click event: type = EV_KEY, code = 272 (LeftBtn), value=1/0

right click event: type = EV_KEY, code = 273 (RightBtn), value = 1/0

mouse wheel event: type = EV_REL, code = 8 (Wheel), value = -1

没有鼠标移动事件。那么我的鼠标移动事件发生在哪里以及如何捕获它呢?

ps:在安装了 virtualBox-addition 的 VirtualBox-4 中的 Ubuntu 11.04Gentoo 上进行了测试。

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/0

right click event: type = EV_KEY, code = 273 (RightBtn), value = 1/0

mouse 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: Tested on Ubuntu 11.04 and Gentoo in VirtualBox-4 with virtualBox-addition installed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溺渁∝ 2024-11-13 04:16:03

如果不是在嵌入式 Linux 系统上,我更喜欢使用 input-utils 工具,而不是 evtest (如果我在 Android 上,我使用 cat /proc/ Bus/input/devicesgetevent

通过以下方式安装 input-utils:

$ 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

然后我读取笔记本电脑跟踪点上的事件(不要忘记在启动后移动它)输入事件)

$ 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_REL

waiting for events
16:43:46.516075: EV_REL REL_Y -1
16:43:46.516090: EV_SYN code=0 value=0
16:43:46.539642: EV_REL REL_X -1
16:43:46.539656: EV_REL REL_Y -1
16:43:46.539660: EV_SYN code=0 value=0
16:43:46.704385: EV_REL REL_Y -1
16:43:46.704401: EV_SYN code=0 value=0

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 )

Install input-utils via:

$ sudo apt-get install input-utils

List all my input devices

$ 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_REL

waiting for events
16:43:46.516075: EV_REL REL_Y -1
16:43:46.516090: EV_SYN code=0 value=0
16:43:46.539642: EV_REL REL_X -1
16:43:46.539656: EV_REL REL_Y -1
16:43:46.539660: EV_SYN code=0 value=0
16:43:46.704385: EV_REL REL_Y -1
16:43:46.704401: EV_SYN code=0 value=0
无言温柔 2024-11-13 04:16:03

您是否尝试过实际移动鼠标而不是 evtest?
当我移动鼠标时,我在 /dev/input/event* 上没有得到任何东西,但在 /dev/input/by-path/platform-i8042-serio-1-event-mouse 上却得到了任何东西。当我使用 /dev/input/by-path/platform-i8042-serio-1-event-mouse 并在 Synergy 上移动鼠标时,我也没有得到任何信息,我必须物理移动鼠标。

萨赫

Have you tried actually moving the mouse rather than evtest?
I don't get anything on /dev/input/event* when I move my mouse but do on /dev/input/by-path/platform-i8042-serio-1-event-mouse. I also don't get anything when I use /dev/input/by-path/platform-i8042-serio-1-event-mouse and move the mouse across Synergy, I have to physically move the mouse.

Sach

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文