reduce scan delay for better initial detection

This commit is contained in:
e7d 2020-08-18 11:49:38 +02:00
parent 62daa08c7a
commit eaea41db0e
No known key found for this signature in database
GPG Key ID: F320BE007C0B8881

View File

@ -70,7 +70,7 @@ class Gamepad {
this.helpDelay = 12000;
// active gamepad default values
this.scanDelay = 500;
this.scanDelay = 200;
this.debug = false;
this.index = null;
this.type = null;
@ -419,11 +419,15 @@ class Gamepad {
// determine gamepad type
this.type = this.getType(gamepad);
this.identifier = this.identifiers[this.type];
this.colorIndex = 0;
// ensure a valid gamepad type was discovered
if (!this.type) return;
// initial setup of the gamepad
this.identifier = this.identifiers[this.type];
this.colorIndex = 0;
this.changeGamepadColor(this.identifier.colors[this.colorIndex]);
// load the HTML template file
this.loadTemplate(gamepad);