Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't get the mouse move event from /dev/input/event*

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.

like image 326
Peng Liang Avatar asked May 10 '11 11:05

Peng Liang


1 Answers

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
like image 172
Rian Sanderson Avatar answered Sep 30 '22 06:09

Rian Sanderson