From 8fa5d0bf51083756e1a7ead11afae490a09542ab Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 20 Jun 2014 14:16:13 +1000 Subject: touchpad: disable tapping for fingers exceeding the timeout/motion threshold The current code triggers multi-finger tapping even if the finger released was previously held on the touchpad for a while. For an event sequence of: 1. first finger down 2. first finger move past threshold/wait past timeout 3. second finger down 4. first finger up The second finger initiates the two-finger tap state, but the button event is sent when the first finger releases - despite that finger not meeting the usual tap constraints. This sequence can happen whenever a user swaps fingers. Add the finger state to the actual touchpoints and update them whenever the constrains are broken. Then, discard button events if the respective touch did not meet the conditions. http://bugs.freedesktop.org/76760 Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- doc/touchpad-tap-state-machine.svg | 1527 ++++++++++++++++++------------------ 1 file changed, 756 insertions(+), 771 deletions(-) (limited to 'doc/touchpad-tap-state-machine.svg') diff --git a/doc/touchpad-tap-state-machine.svg b/doc/touchpad-tap-state-machine.svg index 50ebc71..10739c6 100644 --- a/doc/touchpad-tap-state-machine.svg +++ b/doc/touchpad-tap-state-machine.svg @@ -1,771 +1,756 @@ -IDLETOUCHfirstfinger downfinger upbutton -1presstimeoutmove > thresholdsecondfinger downTOUCH_2secondfinger upbutton -2pressmove > -thresholdtimeoutbutton 1releasebutton -2releaseTAPPEDtimeoutfirstfinger downDRAGGINGfirstfinger upbtn1releaseIDLEthirdfinger downTOUCH_3secondfinger upbutton 3pressbutton 3releasemove > thresholdIDLEtimeoutthirdfinger upfirstfinger upIDLEfourthfinger downDRAGGING_OR_DOUBLETAPtimeoutfirstfinger upbutton -1releasebutton -1pressbtn1releasesecondfinger downmove > thresholdHOLDfirstfinger upsecondfinger downTOUCH_2_HOLDsecondfinger upfirstfinger upthirdfinger downTOUCH_3_HOLDsecondfinger upthirdfinger upfourthfinger downDEADsecondfinger upthirdfinger upfourthfinger downfirstfinger upfirstfinger upfirstfinger upIDLEif fingercount == 0secondfinger upDRAGGING_2firstfinger upsecondfinger downthirdfinger downbtn1releasephysbuttonpressfourthfinger downphysbuttonpressbutton 1releaseDRAGGING_WAITtimeoutfirstfinger down + + + + + + + + + + + + + IDLE + + + + TOUCH + + + + first + finger down + + + + + + finger up + + + + + + button 1 + press + + + + timeout + + + + + + move > + threshold + + + + + + second + finger down + + + + + + TOUCH_2 + + + + second + finger up + + + + + + button 2 + press + + + + move > + threshold + + + + timeout + + + + + + + + button 1 + release + + + + button 2 + release + + + + + + + + TAPPED + + + + timeout + + + + + + first + finger down + + + + + + DRAGGING + + + + first + finger up + + + + btn1 + release + + + + + + + + + + IDLE + + + + third + finger down + + + + + + TOUCH_3 + + + + + + button 3 + press + + + + button 3 + release + + + + + + move > + threshold + + + + + + IDLE + + + + timeout + + + + + + first + finger up + + + + + + IDLE + + + + fourth + finger down + + + + + + + + DRAGGING_OR_DOUBLETAP + + + + + + timeout + + + + + + first + finger up + + + + + + button 1 + release + + + + button 1 + press + + + + btn1 + release + + + + + + + + + + + + second + finger down + + + + + + move > + threshold + + + + + + + + HOLD + + + + first + finger up + + + + + + + + second + finger down + + + + + + + + + + TOUCH_2_HOLD + + + + second + finger up + + + + + + first + finger up + + + + + + + + + + third + finger down + + + + + + + + + + TOUCH_3_HOLD + + + + + + fourth + finger down + + + + DEAD + + + + + + + + + + any finger up + + + + fourth + finger up + + + + any finger up + + + + + + + + yes + + + + any finger up + + + + + + + + + + + + IDLE + + + + if finger + count == 0 + + + + + + + + + + second + finger up + + + + DRAGGING_2 + + + + + + + + first + finger up + + + + + + + + + + second + finger down + + + + + + + + + + third + finger down + + + + + + btn1 + release + + + + + + phys + button + press + + + + + + + + + + + + + + + + phys + button + press + + + + + + button 1 + release + + + + + + + + + + + + + + DRAGGING_WAIT + + + + timeout + + + + + + + + + + first + finger down + + + + + + TOUCH_TOUCH + + + + TOUCH_IDLE + + + + + + + + + + + + TOUCH_DEAD + + + + + + + + + + + + + + yes + + + + TOUCH_DEAD + + + + + + + + + + TOUCH_IDLE + + + + + + TOUCH_TOUCH + + + + + + + + TOUCH_IDLE + + + + + + TOUCH_IDLE + + + + + + TOUCH_IDLE + + + + + + TOUCH_TOUCH + + + + + + that finger + TOUCH_IDLE + + + + + + TOUCH_DEAD + + + + + + + + + + that finger + TOUCH_IDLE + + + + + + + + no + + + + TOUCH_TOUCH + + + + + + TOUCH_IDLE + + + + + + TOUCH_TOUCH + + + + + + TOUCH_DEAD + + + + + + + + TOUCH_IDLE + + + + + + TOUCH_TOUCH + + + + + + + + TOUCH_TOUCH + + + + + + TOUCH_IDLE + + + + + + TOUCH_IDLE + + + + + + TOUCH_TOUCH + + + + + + TOUCH_IDLE + + + + + + TOUCH_TOUCH + + + + + + that finger + TOUCH_IDLE + + + + + + TOUCH_DEAD + + + + + + TOUCH_DEAD + + + + TOUCH_DEAD + + + + TOUCH_DEAD + + + + + + TOUCH_DEAD + + + + + + TOUCH_DEAD + + + + + + state == + TOUCH_TOUCH + + + + that finger state == + TOUCH_TOUCH + + + + + + no + + + + TOUCH_DEAD + + + + + + TOUCH_DEAD + + + + TOUCH_DEAD + + + -- cgit v1.2.3