Use fling tap down gesture as a signal for touchpad contact
... to show the mouse cursor icon immediately upon contact with the touchpad. While the gestures library contains kGestureTypeContactInitiated, it is no longer used. Instead, when there is contact with the touchpad, the library produces a fling tap down gesture. The fling tap down gesture can be used as a signal to mark the end of a previouly started fling event. However, since the fling tap down gesture being generated roughly corresponds to a stable contact being detected in the current version of the library, we can use it as an alias for "contact initiated" as a workaround. This works because the fling tap down gesture is produced even if there was no fling start gesture produced in the past. Whenever we detect that a contact is initiated, we treat is as a move event of zero magnitude so that the mouse cursor is shown and a hover event is produced for apps to update their UI. An alternative approach that was considered was to track touching pointers from the evdev state, and use that ensure PointerController is showing the cursor whenever there is a valid pointer. This was disregarded as it could lead to inconsistencies with the gesture library. For example, if the gestures library immediately detects a contact as a palm, we don't want the cursor to be shown. Bug: 281671810 Test: atest inputflinger_tests Test: manual, with touchpad Change-Id: I01dbdd8a139cc6766fcd7e545a961e32237c2af9
Loading
Please register or sign in to comment