mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-13 03:51:10 +00:00
fix(input): end the forwarded touchpad finger when the Steam menu opens
This commit is contained in:
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 {
|
||||
|
||||
Reference in new issue
Block a user