else if(in.code == ABS_MT_TRACKING_ID) {
if(in.value == -1)
evdev_button = LV_INDEV_STATE_REL;
else if(in.value == 0)
evdev_button = LV_INDEV_STATE_PR;
}
So I understand it as ABS_MT_TRACKING_ID should increase for identify each touch events - at least to multi-touch device - so I tried to evtest. and this is result. It seems too long but I didn't cut because If upper section of device helps:
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: gpio_keys_polled
/dev/input/event1: ssd253x
Select the device event number [0-1]: 1
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "ssd253x"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min 0
Max 799
Event code 1 (ABS_Y)
Value 0
Min 0
Max 479
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 9
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 799
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 479
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Event code 58 (ABS_MT_PRESSURE)
Value 0
Min 0
Max 16
Properties:
Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 1697531620.958962, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 9
Event: time 1697531620.958962, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 398
Event: time 1697531620.958962, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 209
Event: time 1697531620.958962, -------------- EV_SYN ------------
Event: time 1697531620.975913, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 11
Event: time 1697531620.975913, -------------- EV_SYN ------------
Event: time 1697531620.985108, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 397
Event: time 1697531620.985108, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 208
Event: time 1697531620.985108, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 9
Event: time 1697531620.985108, -------------- EV_SYN ------------
Event: time 1697531621.002052, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 207
Event: time 1697531621.002052, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 5
Event: time 1697531621.002052, -------------- EV_SYN ------------
Event: time 1697531621.011285, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 394
Event: time 1697531621.011285, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 205
Event: time 1697531621.011285, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 1
Event: time 1697531621.011285, -------------- EV_SYN ------------
Event: time 1697531621.024135, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1697531621.024135, -------------- EV_SYN ------------
Event: time 1697531621.874388, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 10
Event: time 1697531621.874388, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 413
Event: time 1697531621.874388, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 213
Event: time 1697531621.874388, -------------- EV_SYN ------------
Event: time 1697531621.891331, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 214
Event: time 1697531621.891331, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 11
Event: time 1697531621.891331, -------------- EV_SYN ------------
Event: time 1697531621.908274, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 9
Event: time 1697531621.908274, -------------- EV_SYN ------------
Event: time 1697531621.942142, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 213
Event: time 1697531621.942142, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 5
Event: time 1697531621.942142, -------------- EV_SYN ------------
Event: time 1697531621.959085, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 211
Event: time 1697531621.959085, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 1
Event: time 1697531621.959085, -------------- EV_SYN ------------
Event: time 1697531621.965738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1697531621.965738, -------------- EV_SYN ------------
Event: time 1697531632.638183, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 11
Event: time 1697531632.638183, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 436
Event: time 1697531632.638183, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 185
Most of ABS_MT_TRACKING_ID seems to have non-zero value - so I changed evdev.c to following lines:
else if(in.code == ABS_MT_TRACKING_ID) {
printf("in.code is ABS_MT_TRACKING_ID: %d\n", in.value);
if(in.value == -1)
evdev_button = LV_INDEV_STATE_REL;
--- else if(in.value == 0)
+++ else
evdev_button = LV_INDEV_STATE_PR;
}
Because I thought all of non-negative value of ABS_MT_TRACKING_ID means touchscreen has pressed.
And then I tested my app and demo app again - It works fine.
I think it could be merge to origin because it will be no harm, but I'll be appreciated to tell me if I missed something or wrong.