Fix[gamepad]: fix logic issue with toggleable gamepad buttons

This commit is contained in:
Maksim Belov 2024-09-22 18:59:00 +03:00
parent 366f181533
commit b236447c42

View File

@ -10,7 +10,8 @@ public class GamepadButton extends GamepadEmulatedButton {
@Override @Override
protected void onDownStateChanged(boolean isDown) { protected void onDownStateChanged(boolean isDown) {
if(isToggleable && isDown){ if(isToggleable) {
if(!isDown) return;
mIsToggled = !mIsToggled; mIsToggled = !mIsToggled;
Gamepad.sendInput(keycodes, mIsToggled); Gamepad.sendInput(keycodes, mIsToggled);
return; return;