Ignore key events in message pump if they aren't accelerators. Fixes alt-f4 closing sdl renderer window.

This commit is contained in:
ts-korhonen
2021-06-15 15:26:04 +03:00
parent 6bd2ba28ce
commit 7941659ad0

View File

@@ -1533,7 +1533,15 @@ ui_init(int nCmdShow)
break;
}
if (! TranslateAccelerator(hwnd, haccel, &messages)) {
if (! TranslateAccelerator(hwnd, haccel, &messages))
{
/* Don't process other keypresses. */
if (messages.message == WM_SYSKEYDOWN ||
messages.message == WM_SYSKEYUP ||
messages.message == WM_KEYDOWN ||
messages.message == WM_KEYUP)
continue;
TranslateMessage(&messages);
DispatchMessage(&messages);
}