fix: release held pad input when the controller screen loses focus

This commit is contained in:
Kurt Himebauch committed 2026-11-06 12:33:26 -05:00
1 parent 1288874810
commit 643496ae70
1 file changed
+9
@@ -126,6 +126,15 @@ class BtControllerActivity : ComponentActivity() {
if (!nearbyDenied) startPad()
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) return
physical.set(BtPadState())
keyButtons = 0
hatButtons = 0
push()
}
override fun onDestroy() {
main.removeCallbacks(exitHold)
if (isFinishing) BtGamepad.stop()