fix: three-finger tap opens the keyboard in touchpad mode (#1903)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-31 13:55:03 -04:00
1 parent d691bcf832
commit b63feb5eaa
4 files changed
+21 -3

No files matched your search

@@ -33,7 +33,9 @@ class TouchpadGesturesTest {
override fun onScroll(dx: Float, dy: Float) { events += "scroll" }
override fun onScrollEnd() { events += "scroll end" }
override fun onZoom(steps: Int) { events += "zoom $steps" }
override fun onThreeFingerTap(): Boolean { events += "three tap"; return claimThreeTap }
}
private var claimThreeTap = false
@Before fun setUp() {
touchpad = TouchpadGestures(SLOP, listener)
@@ -50,7 +52,18 @@ class TouchpadGesturesTest {
assertEquals(listOf("left down", "left up"), events)
}
@Test fun threeFingerTapClicksTheMiddleButton() {
@Test fun threeFingerTapClicksTheMiddleButtonWhenUnclaimed() {
threeFingerTap()
assertEquals(listOf("three tap", "middle down", "middle up"), events)
}
@Test fun claimedThreeFingerTapSkipsTheMiddleButton() {
claimThreeTap = true
threeFingerTap()
assertEquals(listOf("three tap"), events)
}
private fun threeFingerTap() {
touch(MotionEvent.ACTION_DOWN, 0, 1 to (400f to 300f))
advance(10)
touch(MotionEvent.ACTION_POINTER_DOWN, 1, 1 to (400f to 300f), 2 to (600f to 310f))
@@ -61,7 +74,6 @@ class TouchpadGesturesTest {
touch(MotionEvent.ACTION_POINTER_UP, 1, 1 to (400f to 300f), 2 to (600f to 310f))
touch(MotionEvent.ACTION_UP, 0, 1 to (400f to 300f))
advance(100)
assertEquals(listOf("middle down", "middle up"), events)
}
@Test fun desktopTwoFingerSlideScrollsSmoothlyAndStops() {