mirror of https://github.com/nealey/vail.git
Accept every gamepad button
This commit is contained in:
parent
38514fbc84
commit
74d296d1f3
|
@ -557,9 +557,16 @@ class Vail {
|
||||||
if (gp == null) {
|
if (gp == null) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
currentButtons.key |= gp.buttons[0].pressed || gp.buttons[1].pressed
|
for (let i in gp.buttons) {
|
||||||
currentButtons.dit |= gp.buttons[2].pressed || gp.buttons[4].pressed || gp.buttons[6].pressed
|
let pressed = gp.buttons[i].pressed
|
||||||
currentButtons.dah |= gp.buttons[3].pressed || gp.buttons[5].pressed || gp.buttons[7].pressed
|
if (i < 2) {
|
||||||
|
currentButtons.key |= pressed
|
||||||
|
} else if (i % 2 == 0) {
|
||||||
|
currentButtons.dit |= pressed
|
||||||
|
} else {
|
||||||
|
currentButtons.dah |= pressed
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentButtons.key != this.gamepadButtons.key) {
|
if (currentButtons.key != this.gamepadButtons.key) {
|
||||||
|
|
Loading…
Reference in New Issue