Reputation: 2757
I'm using libevdev and having trouble understanding how I can detect multiple touch downs / ups. As shown on this libevdev tutorial you can see that on the last example on the page, there are two touches occuring. However, only twoBTN_TOUCH
events are received, one for the first finger down, and then when the last finger comes up. No BTN_TOUCH
happens for the second / intermediate touches. So how can I know when a second touch goes up and comes back down (ie, transition from a two finger gesture to a one finger gesture)?
Here's my log for two finger's down and both back up:
EV_KEY BTN_TOOL_FINGER ), value 1
EV_KEY BTN_TOUCH ), value 1
EV_ABS ABS_MT_TRACKING_ID ), value 0
EV_ABS ABS_MT_POSITION_X ), value 1718
EV_ABS ABS_MT_POSITION_Y ), value 1161
EV_ABS ABS_MT_PRESSURE ), value 51
EV_ABS ABS_MT_TOUCH_MAJOR ), value 1
EV_ABS ABS_MT_TOUCH_MINOR ), value 1
EV_ABS ABS_MT_ORIENTATION ), value 0
EV_SYN SYN_MT_REPORT ), value 0
EV_SYN SYN_REPORT ), value 0
EV_ABS ABS_MT_TRACKING_ID ), value 0
EV_ABS ABS_MT_POSITION_X ), value 1718
EV_ABS ABS_MT_POSITION_Y ), value 1161
EV_ABS ABS_MT_PRESSURE ), value 51
EV_ABS ABS_MT_TOUCH_MAJOR ), value 1
EV_ABS ABS_MT_TOUCH_MINOR ), value 1
EV_ABS ABS_MT_ORIENTATION ), value 0
EV_SYN SYN_MT_REPORT ), value 0
EV_SYN SYN_REPORT ), value 0
EV_ABS ABS_MT_TRACKING_ID ), value 0
EV_ABS ABS_MT_POSITION_X ), value 1717
EV_ABS ABS_MT_POSITION_Y ), value 1159
EV_ABS ABS_MT_PRESSURE ), value 43
EV_ABS ABS_MT_TOUCH_MAJOR ), value 1
EV_ABS ABS_MT_TOUCH_MINOR ), value 1
EV_ABS ABS_MT_ORIENTATION ), value 0
EV_SYN SYN_MT_REPORT ), value 0
EV_ABS ABS_MT_TRACKING_ID ), value 1
EV_ABS ABS_MT_POSITION_X ), value 2148
EV_ABS ABS_MT_POSITION_Y ), value 1066
EV_ABS ABS_MT_PRESSURE ), value 18
EV_ABS ABS_MT_TOUCH_MAJOR ), value 1
EV_ABS ABS_MT_TOUCH_MINOR ), value 1
EV_ABS ABS_MT_ORIENTATION ), value 0
EV_SYN SYN_MT_REPORT ), value 0
EV_SYN SYN_REPORT ), value 0
EV_KEY BTN_TOUCH ), value 0
EV_KEY BTN_TOOL_FINGER ), value 0
EV_SYN SYN_REPORT ), value 0
And when one finger comes up and goes back down, while another finger remains on the screen, all I get is repeating portions of this:
(EV_ABS), code 57( 57 -> 32, 32 == ABS_MT_TRACKING_ID ), value 0
(EV_ABS), code 53( 53 -> 47, 47 == ABS_MT_POSITION_X ), value 1395
(EV_ABS), code 54( 54 -> 0, 65506 == ABS_MT_POSITION_Y ), value 2086
(EV_ABS), code 58( 58 -> 0, 65509 == ABS_MT_PRESSURE ), value 127
(EV_ABS), code 48( 48 -> 98, 98 == ABS_MT_TOUCH_MAJOR ), value 1
(EV_ABS), code 49( 49 -> 110, 110 == ABS_MT_TOUCH_MINOR ), value 1
(EV_ABS), code 52( 52 -> 46, 46 == ABS_MT_ORIENTATION ), value 0
(EV_SYN), code 2( 2 -> 49, 49 == SYN_MT_REPORT ), value 0
(EV_SYN), code 0( 0 -> 0, 0 == SYN_REPORT ), value 0
Upvotes: 0
Views: 674
Reputation: 431
Use the BTN_TOOL_<DEVICE>
event tools. For your case it would be BTN_TOOL_DOUBLETAP
. You can view more information about those here https://www.kernel.org/doc/Documentation/input/event-codes.txt
Upvotes: 1