- fixed: Key up events were processed as character input.

This broke the cheat input in Duke Nukem.
This commit is contained in:
Christoph Oelckers 2020-01-03 19:28:17 +01:00
parent 13a7b7d4b2
commit 064a453b41

View file

@ -120,7 +120,7 @@ void InputState::AddEvent(const event_t *ev)
if (ev->type == EV_KeyDown || ev->type == EV_KeyUp) if (ev->type == EV_KeyDown || ev->type == EV_KeyUp)
{ {
keySetState(ev->data1, ev->type == EV_KeyDown); keySetState(ev->data1, ev->type == EV_KeyDown);
if (ev->data2) if (ev->data2 && ev->type == EV_KeyDown)
{ {
g_keyAsciiFIFO[g_keyAsciiEnd] = (char16_t)ev->data2; g_keyAsciiFIFO[g_keyAsciiEnd] = (char16_t)ev->data2;
g_keyAsciiEnd = ((g_keyAsciiEnd + 1) & (KEYFIFOSIZ - 1)); g_keyAsciiEnd = ((g_keyAsciiEnd + 1) & (KEYFIFOSIZ - 1));