mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 13:43:32 +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,
|
static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
||||||
WPARAM wparam, LPARAM lparam)
|
WPARAM wparam, LPARAM lparam)
|
||||||
{
|
{
|
||||||
|
bool keydown = true;
|
||||||
|
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case WM_NCLBUTTONDBLCLK:
|
case WM_NCLBUTTONDBLCLK:
|
||||||
@ -887,13 +889,15 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
case WM_SYSKEYUP:
|
case WM_SYSKEYUP:
|
||||||
|
/* Key released */
|
||||||
|
keydown = false;
|
||||||
|
/* fall-through */
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
case WM_SYSKEYDOWN:
|
case WM_SYSKEYDOWN:
|
||||||
*quit = true;
|
*quit = true;
|
||||||
{
|
{
|
||||||
uint16_t mod = 0;
|
uint16_t mod = 0;
|
||||||
unsigned keycode = 0;
|
unsigned keycode = 0;
|
||||||
bool keydown = true;
|
|
||||||
unsigned keysym = (lparam >> 16) & 0xff;
|
unsigned keysym = (lparam >> 16) & 0xff;
|
||||||
#if _WIN32_WINNT >= 0x0501 /* XP */
|
#if _WIN32_WINNT >= 0x0501 /* XP */
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -928,10 +932,6 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Key released? */
|
|
||||||
if (message == WM_KEYUP || message == WM_SYSKEYUP)
|
|
||||||
keydown = false;
|
|
||||||
|
|
||||||
keycode = input_keymaps_translate_keysym_to_rk(keysym);
|
keycode = input_keymaps_translate_keysym_to_rk(keysym);
|
||||||
|
|
||||||
input_keyboard_event(keydown, keycode,
|
input_keyboard_event(keydown, keycode,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user