Holding down SHIFT makes key repeat go crazy quick
Closed this issue · 1 comments
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
- Start a new game
- Click on one of the drivers
- Remove all text using backspace
- Hold down the SHIFT (with your pink)
- 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
The issue happend here in TypeKey
:
dethrace/src/DETHRACE/common/input.c
Lines 791 to 792 in 99473ff
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.