Skip to content

Commit

Permalink
Fix unwanted cleaning of F1 and F2 button masks (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
deeebug authored May 1, 2023
1 parent 3fb6617 commit 60e28c6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,19 @@ GamepadHotkey Gamepad::hotkey()
if (state.dpad == hotkeyF1Down .dpadMask) action = hotkeyF1Down .action;
if (state.dpad == hotkeyF1Left .dpadMask) action = hotkeyF1Left .action;
if (state.dpad == hotkeyF1Right.dpadMask) action = hotkeyF1Right.action;
state.dpad = 0;
state.buttons &= ~(f1Mask);
if (action != HOTKEY_NONE) {
state.dpad = 0;
state.buttons &= ~(f1Mask);
}
} else if (pressedF2()) {
if (state.dpad == hotkeyF2Up .dpadMask) action = hotkeyF2Up .action;
if (state.dpad == hotkeyF2Down .dpadMask) action = hotkeyF2Down .action;
if (state.dpad == hotkeyF2Left .dpadMask) action = hotkeyF2Left .action;
if (state.dpad == hotkeyF2Right.dpadMask) action = hotkeyF2Right.action;
state.dpad = 0;
state.buttons &= ~(f2Mask);
if (action != HOTKEY_NONE) {
state.dpad = 0;
state.buttons &= ~(f2Mask);
}
}

switch (action) {
Expand Down

0 comments on commit 60e28c6

Please sign in to comment.