fix broken buttons refresh
This commit is contained in:
parent
d7cc861f2b
commit
55085c6a5f
@ -544,8 +544,6 @@ class Gamepad {
|
|||||||
|
|
||||||
this.updateButtons(activeGamepad);
|
this.updateButtons(activeGamepad);
|
||||||
this.updateAxes(activeGamepad);
|
this.updateAxes(activeGamepad);
|
||||||
|
|
||||||
this.activeGamepad = activeGamepad;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -556,10 +554,6 @@ class Gamepad {
|
|||||||
updateButtons(gamepad) {
|
updateButtons(gamepad) {
|
||||||
// update the buttons
|
// update the buttons
|
||||||
for (let index = 0; index < gamepad.buttons.length; index++) {
|
for (let index = 0; index < gamepad.buttons.length; index++) {
|
||||||
if (this.activeGamepad && this.activeGamepad.buttons[index].value == gamepad.buttons[index].value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// find the DOM element
|
// find the DOM element
|
||||||
const $button = this.mapping.buttons[index];
|
const $button = this.mapping.buttons[index];
|
||||||
if (!$button) {
|
if (!$button) {
|
||||||
@ -589,10 +583,6 @@ class Gamepad {
|
|||||||
updateAxes(gamepad) {
|
updateAxes(gamepad) {
|
||||||
// update the axes
|
// update the axes
|
||||||
for (let index = 0; index < gamepad.axes.length; index++) {
|
for (let index = 0; index < gamepad.axes.length; index++) {
|
||||||
if (this.activeGamepad && this.activeGamepad.axes[index].value == gamepad.axes[index].value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// find the DOM element
|
// find the DOM element
|
||||||
const $axis = this.mapping.axes[index];
|
const $axis = this.mapping.axes[index];
|
||||||
if (!$axis) {
|
if (!$axis) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user