Skip to content

Viewing Touch Events (evtest)

mgong98 edited this page Sep 19, 2025 · 1 revision

evtest

The evtest tool resides in the Linux kernel as an application which can be used to monitor input device events.
The tool can also be used to query the current state of a key or associated event type for the touches.

Using the putty terminal, typing evtest alone will trigger a list of possible input devices registered in the Host system.

root@<username>:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:     AT42QT1070 QTouch Sensor
/dev/input/event1:     Atmel maXTouch Touchscreen
/dev/input/event2:     gpio_keys
Select the device event number [0-2]:

To get events from a specific input device, the following command can be used.

evtest /dev/input/eventX

Alternatively, the current state of a specific event type or value can be found by using the following command.

evtest --query /dev/input/eventX <type> <value>

After selecting the debug option for evtest, touch event messages will display to the terminal when fingers are present.

The evtest tool will list all the events that occur, touch down, move, and touch release. In the below capture, the multi-touch protocol is being used as indicated by the ABS_MT_SLOT values of 0 and 1 (2 fingers). Legacy single finger coordinates are also sent to user-space as indicated by the ABS_X and ABS_Y event codes.

Event: time 1507021759.651821, -------------- SYN_REPORT ------------
Event: time 1507021759.659294, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 0
Event: time 1507021759.659294, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 959
Event: time 1507021759.659294, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 2467
Event: time 1507021759.659294, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 1
Event: time 1507021759.659294, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 935
Event: time 1507021759.659294, type 3 (EV_ABS), code 47 (ABS_MT_SLOT), value 3
Event: time 1507021759.659294, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 1598
Event: time 1507021759.659294, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 2578
Event: time 1507021759.659294, type 3 (EV_ABS), code 0 (ABS_X), value 959
Event: time 1507021759.659294, type 3 (EV_ABS), code 1 (ABS_Y), value 2467

For a list of event codes and their definitions, see the following location:

https://www.kernel.org/doc/html/latest/input/event-codes.html

Clone this wiki locally