mirror of
https://github.com/libretro/RetroArch
synced 2025-03-20 19:21:27 +00:00
WndProcCommon - small optimization
This commit is contained in:
parent
61c6dc5a70
commit
826b2245ec
@ -841,6 +841,8 @@ static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
||||
static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
||||
WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
bool keydown = true;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_NCLBUTTONDBLCLK:
|
||||
@ -887,13 +889,15 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
||||
return TRUE;
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
/* Key released */
|
||||
keydown = false;
|
||||
/* fall-through */
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
*quit = true;
|
||||
{
|
||||
uint16_t mod = 0;
|
||||
unsigned keycode = 0;
|
||||
bool keydown = true;
|
||||
unsigned keysym = (lparam >> 16) & 0xff;
|
||||
#if _WIN32_WINNT >= 0x0501 /* XP */
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -928,10 +932,6 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Key released? */
|
||||
if (message == WM_KEYUP || message == WM_SYSKEYUP)
|
||||
keydown = false;
|
||||
|
||||
keycode = input_keymaps_translate_keysym_to_rk(keysym);
|
||||
|
||||
input_keyboard_event(keydown, keycode,
|
||||
|
Loading…
x
Reference in New Issue
Block a user