无法从/ dev / input / event *获取鼠标移动事件 [英] can't get the mouse move event from /dev/input/event*

查看:766
本文介绍了无法从/ dev / input / event *获取鼠标移动事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用 evtest 时,我无法获取鼠标移动事件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/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:测试在$ 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_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

这篇关于无法从/ dev / input / event *获取鼠标移动事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆