Work around bug where key after ALT+ENTER was getting swallowed.

This commit is contained in:
casey langen 2017-03-14 00:18:04 -07:00
parent 65bdea5638
commit 62f782469e

View File

@ -1602,6 +1602,7 @@ static void HandlePaint( HWND hwnd )
}
static bool key_already_handled = FALSE;
static int last_key_handled = 0;
static void HandleSyskeyDown( const WPARAM wParam, const LPARAM lParam,
int *ptr_modified_key_to_return )
@ -1665,10 +1666,12 @@ static void HandleSyskeyDown( const WPARAM wParam, const LPARAM lParam,
if( !ctrl_pressed || !alt_pressed || PDC_show_ctrl_alts)
{
add_key_to_queue( key);
if( wParam == VK_MULTIPLY || wParam == VK_DIVIDE
|| wParam == VK_ADD || wParam == VK_SUBTRACT)
//|| wParam == VK_RETURN)
key_already_handled = TRUE;
if (wParam == VK_MULTIPLY || wParam == VK_DIVIDE
|| wParam == VK_ADD || wParam == VK_SUBTRACT
|| wParam == VK_RETURN) {
last_key_handled = key;
key_already_handled = TRUE;
}
}
pdc_key_modifiers = 0;
/* Save the key modifiers if required. Do this first to allow to
@ -2006,9 +2009,10 @@ static LRESULT ALIGN_STACK CALLBACK WndProc (const HWND hwnd,
case WM_CHAR: /* _Don't_ add Shift-Tab; it's handled elsewhere */
if( wParam != 9 || !(GetKeyState( VK_SHIFT) & 0x8000))
if( !key_already_handled)
if( !key_already_handled || last_key_handled != (int)wParam )
add_key_to_queue( (int)wParam );
key_already_handled = FALSE;
last_key_handled = 0;
break;
case WM_KEYDOWN: