Skip to content

Commit

Permalink
BUGFIX: Fix L=A by comparing the rawkeys to the previous keyinput ins…
Browse files Browse the repository at this point in the history
…tead of the converted keys

Also remap newAndRepeatedKeys
  • Loading branch information
AreaZR committed Oct 8, 2024
1 parent 9a24c03 commit 9c1a90e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,13 @@ static void ReadKeys(void)
// because it compares the raw key input with the remapped held keys.
// Note that newAndRepeatedKeys is never remapped either.

#ifdef BUGFIX
if (keyInput != 0 && gMain.heldKeysRaw == keyInput)
#else
if (keyInput != 0 && gMain.heldKeys == keyInput)
#endif
{
gMain.keyRepeatCounter--;

if (gMain.keyRepeatCounter == 0)
if (--gMain.keyRepeatCounter == 0)
{
gMain.newAndRepeatedKeys = keyInput;
gMain.keyRepeatCounter = gKeyRepeatContinueDelay;
Expand All @@ -285,6 +287,10 @@ static void ReadKeys(void)

if (JOY_HELD(L_BUTTON))
gMain.heldKeys |= A_BUTTON;
#ifdef BUGFIX
if (JOY_REPEAT(L_BUTTON))
gMain.newAndRepeatedKeys |= A_BUTTON;
#endif
}

if (JOY_NEW(gMain.watchedKeysMask))
Expand Down

0 comments on commit 9c1a90e

Please sign in to comment.