fix(input): end the forwarded touchpad finger when the Steam menu opens

This commit is contained in:
maxjivi05 authored and MaxsTechReview committed 2026-10-26 15:52:02 -04:00
1 parent 46076e165b
commit aa17b0553d
1 file changed
+11 -1
@@ -675,7 +675,7 @@ class SteamTouchControls(
val e = f?.element
if (event.actionMasked != MotionEvent.ACTION_CANCEL && e != null && reach(e, event.getX(index), event.getY(index)) <= 1.3f) {
when (e.type) {
SteamTouchConfig.THUMB -> openMenu()
SteamTouchConfig.THUMB -> { cancelForwarded(event); openMenu() }
SteamTouchConfig.KEYBOARD -> onKeyboard()
SteamTouchConfig.PASTE -> onPaste()
}
@@ -688,6 +688,16 @@ class SteamTouchControls(
}
private fun cancelForwarded(event: MotionEvent) {
val split = event.pointerSubset(forwardedPointerBits).also { forwardedPointerBits = 0 } ?: return
split.action = MotionEvent.ACTION_CANCEL
try {
onTouchMiss?.invoke(split)
} finally {
split.recycle()
}
}
private fun forwardPointers(event: MotionEvent, pointerIdBits: Int) {
val split = event.pointerSubset(pointerIdBits) ?: return
try {