Skip to content

Debloat your Android TV, install apps, browse and transfer files on it, all from your phone. Just 3 MB, no tracking, no root, no PC.

Close the Remote's keyboard on a perfectly still tap

jesse-agent-232f5a83decaa30
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a83c1eb..bdd2434 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,8 @@ until this file has a section for its version.
## Unreleased
+- **Fixed:** On the Remote, a perfectly still tap on empty space now closes the keyboard. [#300](../../pull/300)
+
## 0.14.0 — 2026-10-30
- **New:** Hindi, Chinese, Japanese, Russian and Spanish support, machine-made; corrections welcome. [#272](../../pull/272)
diff --git a/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt b/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt
index f638cac..91ceb09 100644
--- a/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt
+++ b/app/src/main/java/app/tellyscope/ui/RemoteScreen.kt
@@ -96,6 +96,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.PathParser
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
import androidx.compose.ui.input.pointer.PointerEventPass
+import androidx.compose.ui.input.pointer.changedToUp
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.onGloballyPositioned
@@ -275,8 +276,14 @@ fun RemoteScreen(
awaitEachGesture {
val down = awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Initial)
if (field.contains(origin + down.position)) return@awaitEachGesture
- // Null when something else took the lift (a key, a button, a drag of the sheet): leave the keyboard be.
- if (waitForUpOrCancellation(PointerEventPass.Final) != null) focus.clearFocus()
+ // Read the lift ourselves: waitForUpOrCancellation(Final) awaits one more Final event as its
+ // consume check, so on a still tap it swallows the up and never returns.
+ // Consumed means something else took it (a key, a button, a drag of the sheet): leave the keyboard be.
+ while (true) {
+ val change = awaitPointerEvent(PointerEventPass.Final).changes.firstOrNull { it.id == down.id } ?: continue
+ if (change.isConsumed) break
+ if (change.changedToUp()) { focus.clearFocus(); break }
+ }
}
},
) {