update controllers detection codes
This commit is contained in:
parent
93836c3819
commit
86e71288db
@ -30,18 +30,23 @@ class Gamepad {
|
|||||||
// gamepad collection default values
|
// gamepad collection default values
|
||||||
this.gamepads = {};
|
this.gamepads = {};
|
||||||
this.gamepadIdentifiers = {
|
this.gamepadIdentifiers = {
|
||||||
debug: {
|
"debug": {
|
||||||
id: /debug/,
|
id: /debug/,
|
||||||
name: "Debug",
|
name: "Debug",
|
||||||
colors: [],
|
colors: [],
|
||||||
},
|
},
|
||||||
ds4: {
|
"ds4": {
|
||||||
id: /054c.*?05c4/,
|
id: /054c.*?05c4/,
|
||||||
name: "DualShock 4",
|
name: "DualShock 4",
|
||||||
colors: ["black", "white", "red", "blue"],
|
colors: ["black", "white", "red", "blue"],
|
||||||
},
|
},
|
||||||
|
// "switch-pro": {
|
||||||
|
// id: /057e.*?2009/,
|
||||||
|
// name: "Switch Pro Controller",
|
||||||
|
// colors: ["black"],
|
||||||
|
// },
|
||||||
"xbox-one": {
|
"xbox-one": {
|
||||||
id: /xinput|XInput|045e.*?02ea/,
|
id: /045e.*?02ea|xinput|XInput/,
|
||||||
name: "Xbox One",
|
name: "Xbox One",
|
||||||
colors: ["black", "white"],
|
colors: ["black", "white"],
|
||||||
},
|
},
|
||||||
@ -532,8 +537,8 @@ class Gamepad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// enqueue the next refresh right away
|
// enqueue the next refresh right away
|
||||||
window.setTimeout(this.updateStatus.bind(this), 1000 / 60);
|
// window.setTimeout(this.updateStatus.bind(this), 1000 / 60);
|
||||||
// window.requestAnimationFrame(this.updateStatus.bind(this));
|
window.requestAnimationFrame(this.updateStatus.bind(this));
|
||||||
|
|
||||||
// load latest gamepad data
|
// load latest gamepad data
|
||||||
this.refreshGamepads();
|
this.refreshGamepads();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user