Closed madebr closed 1 year ago
The issue happend here in TypeKey
:
https://github.com/dethrace-labs/dethrace/blob/99473ffdf53cc6565ed8beac6a9bcfc1805f98e8/src/DETHRACE/common/input.c#L791-L792
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.
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
Expected result
The letter is entered, with a moderate speed
Actual result
The complete input box is filled with the letter