Skip to content

Viewing Touch Events (getevent)

mgong98 edited this page Sep 19, 2025 · 1 revision

getevent

The Android getevent tool can be found in the kernel of Android distributions. The tool provides input event information that is reported from the kernel.

You can find more information regarding getevent at the following location:

https://source.android.com/devices/input/getevent

Issuing the following command will display the device information in the terminal window.

getevent -i

 add device 1: /dev/input/event2
   name:     "Atmel maXTouch Touchscreen"
 add device 2: /dev/input/event1
   name:     "ad7280-haptic"
 add device 3: /dev/input/event0
   name:     "qpnp_pon"

Then use the command to request outputs from just event2:

 getevent /dev/input/event2

       Or
 getevent -l dev/input/event2

Touching the touchscreen will produce the following output

 /dev/input/event2: 0003 0035 000002fc
 /dev/input/event2: 0003 0036 00000662
 /dev/input/event2: 0003 0000 000002fc
 /dev/input/event2: 0003 0001 00000662
 /dev/input/event2: 0000 0000 00000000
 /dev/input/event2: 0003 0035 000002f3
 /dev/input/event2: 0003 0036 00000666
 /dev/input/event2: 0003 0000 000002f3
 /dev/input/event2: 0003 0001 00000666
 /dev/input/event2: 0000 0000 00000000
 /dev/input/event2: 0003 0039 ffffffff
 /dev/input/event2: 0001 014a 00000000

Using the following -l argument will produce a decoded output

 /dev/input/event2: EV_ABS       ABS_MT_TRACKING_ID   00000005
 /dev/input/event2: EV_ABS       ABS_MT_POSITION_X    000002c4
 /dev/input/event2: EV_ABS       ABS_MT_POSITION_Y    0000062b
 /dev/input/event2: EV_KEY       BTN_TOUCH            DOWN
 /dev/input/event2: EV_ABS       ABS_X                000002c4
 /dev/input/event2: EV_ABS       ABS_Y                0000062b
 /dev/input/event2: EV_SYN       SYN_REPORT           00000000
 /dev/input/event2: EV_ABS       ABS_MT_POSITION_X    000002ca
 /dev/input/event2: EV_ABS       ABS_X                000002ca
 /dev/input/event2: EV_SYN       SYN_REPORT           00000000
 /dev/input/event2: EV_ABS       ABS_MT_POSITION_X    000002cb
 /dev/input/event2: EV_ABS       ABS_X                000002cb
 /dev/input/event2: EV_SYN       SYN_REPORT           00000000
 /dev/input/event2: EV_ABS       ABS_MT_TRACKING_ID   ffffffff
 /dev/input/event2: EV_KEY       BTN_TOUCH            UP
 /dev/input/event2: EV_SYN       SYN_REPORT           00000000

Clone this wiki locally