mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
inpututil: bug fix: AppendJustReleasedGamepadButtons
and AppendJustReleasedStandardGamepadButtons
returned just-pressed buttons
Closes #3147
This commit is contained in:
parent
aeff4c2843
commit
c5e47c7166
@ -461,14 +461,12 @@ func AppendJustReleasedGamepadButtons(id ebiten.GamepadID, buttons []ebiten.Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
for b := ebiten.GamepadButton(0); b <= ebiten.GamepadButtonMax; b++ {
|
for b := ebiten.GamepadButton(0); b <= ebiten.GamepadButtonMax; b++ {
|
||||||
if theInputState.gamepadButtonDurations[id][b] == 0 {
|
if theInputState.gamepadButtonDurations[id][b] != 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if theInputState.prevGamepadButtonDurations[id][b] == 0 {
|
||||||
if theInputState.prevGamepadButtonDurations[id][b] > 0 {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
buttons = append(buttons, b)
|
buttons = append(buttons, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,14 +584,12 @@ func AppendJustReleasedStandardGamepadButtons(id ebiten.GamepadID, buttons []ebi
|
|||||||
}
|
}
|
||||||
|
|
||||||
for b := ebiten.StandardGamepadButton(0); b <= ebiten.StandardGamepadButtonMax; b++ {
|
for b := ebiten.StandardGamepadButton(0); b <= ebiten.StandardGamepadButtonMax; b++ {
|
||||||
if theInputState.standardGamepadButtonDurations[id][b] == 0 {
|
if theInputState.standardGamepadButtonDurations[id][b] != 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if theInputState.prevStandardGamepadButtonDurations[id][b] == 0 {
|
||||||
if theInputState.prevStandardGamepadButtonDurations[id][b] > 0 {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
buttons = append(buttons, b)
|
buttons = append(buttons, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user