mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
fix: release held pad input when the controller screen loses focus
This commit is contained in:
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()
|
||||
|
||||
Reference in new issue
Block a user