faster gamepad detection on button press

This commit is contained in:
e7d 2020-07-06 09:49:11 +02:00
parent c3eaa0821a
commit e046a8697a
No known key found for this signature in database
GPG Key ID: F320BE007C0B8881

View File

@ -187,7 +187,7 @@ class Gamepad {
*/ */
onGamepadConnect(e) { onGamepadConnect(e) {
// on gamepad connection, refresh available gamepads list // on gamepad connection, refresh available gamepads list
this.refresh(e.gamepad); this.scan();
} }
/** /**
@ -198,6 +198,7 @@ class Gamepad {
onGamepadDisconnect(e) { onGamepadDisconnect(e) {
// on gamepad disconnection, remove it from the list // on gamepad disconnection, remove it from the list
this.disconnect(e.gamepad.index); this.disconnect(e.gamepad.index);
this.scan();
} }
/** /**