Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Holding down SHIFT makes key repeat go crazy quick #321

Closed
madebr opened this issue May 2, 2023 · 1 comment · Fixed by #323
Closed

Holding down SHIFT makes key repeat go crazy quick #321

madebr opened this issue May 2, 2023 · 1 comment · Fixed by #323

Comments

@madebr
Copy link
Collaborator

madebr commented May 2, 2023

In places where you can enter text, such as the Driver Selection menu or Save Game menu, when you hold down the SHIFT key while entering text, the text is repeated very fast.

How to reproduce

  1. Start a new game
  2. Click on one of the drivers
  3. Remove all text using backspace
  4. Hold down the SHIFT (with your pink)
  5. Press any other letter key

Expected result

The letter is entered, with a moderate speed

Actual result

The complete input box is filled with the letter

@madebr
Copy link
Collaborator Author

madebr commented May 2, 2023

The issue happend here in TypeKey:

default:
DoRLTypeLetter(PDGetASCIIFromKey(pKey), pSlot_index);

The PDGetASCIIFromKey checks whether the SHIFT key is down, which will modify the last key that was down.

Modifying the above lines to:

{
    printf("before: gLast_key_down=%d\n", gLast_key_down);
    int v = PDGetASCIIFromKey(pKey);
    printf("after: gLast_key_down=%d\n", gLast_key_down);
    DoRLTypeLetter(v, pSlot_index);
}

will print the following output (with #322 applied) when typing text with the SHIFT key down.

before: gLast_key_down=21
after: gLast_key_down=0

Because gLast_key_down was modified to KEY_SHIFT_ALL, the code will a new key has been entered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant