keyboard support for windows

This commit is contained in:
Thomas Bernard 2018-06-20 17:29:05 +02:00
parent 5e628eb499
commit deac8b83cf
2 changed files with 16 additions and 0 deletions

View File

@ -1163,7 +1163,14 @@ int Get_input(int sleep_time)
return 1;
}
if (user_feedback_required)
{
// Process the WM_CHAR event that follow WM_KEYDOWN
if(PeekMessage(&msg, NULL, WM_CHAR, WM_CHAR, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 1;
}
#endif
return 0;
}

View File

@ -122,6 +122,15 @@ static LRESULT CALLBACK Win32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
Key = KEY_MOUSEMIDDLE|Get_Key_modifiers();
return 0;
// WM_MBUTTONDBLCLK
case WM_KEYDOWN: // lParam & 0xffff => repeat count. (lParam >> 16) & 0x1ff => scancode
Key = wParam;
user_feedback_required = 1;
return 0;
case WM_KEYUP:
return 0;
case WM_CHAR:
Key_ANSI = Key_UNICODE = wParam;
return 0;
default:
{
char msg[256];