internal/gamepad: bug fix: compile error

Updates #2027
This commit is contained in:
Hajime Hoshi 2022-03-25 14:34:52 +09:00
parent 5bb22d2bcf
commit e4d0050452

View File

@ -328,7 +328,7 @@ func (g *nativeGamepad) update(gamepad *gamepads) error {
switch e.typ { switch e.typ {
case unix.EV_KEY: case unix.EV_KEY:
if e.code-_BTN_MISC < len(g.keyMap) { if int(e.code)-_BTN_MISC < len(g.keyMap) {
idx := g.keyMap[e.code-_BTN_MISC] idx := g.keyMap[e.code-_BTN_MISC]
g.buttons[idx] = e.value != 0 g.buttons[idx] = e.value != 0
} }