From eeef8c62ede80df48406a0d8a317da7b47687582 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 13 Feb 2003 15:32:15 +0000 Subject: [PATCH] replaced PeekMessage() -> handleMessages() --- src/native/win32/org_lwjgl_input_Keyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/native/win32/org_lwjgl_input_Keyboard.cpp b/src/native/win32/org_lwjgl_input_Keyboard.cpp index 63b1d8ed..7cc6cba1 100644 --- a/src/native/win32/org_lwjgl_input_Keyboard.cpp +++ b/src/native/win32/org_lwjgl_input_Keyboard.cpp @@ -54,6 +54,8 @@ bool translationEnabled; extern LPDIRECTINPUT lpdi; extern HWND hwnd; +extern void handleMessages(void); + /* * Class: org_lwjgl_input_Keyboard * Method: initIDs @@ -185,7 +187,6 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead static DIDEVICEOBJECTDATA rgdod[KEYBOARD_BUFFER_SIZE]; wchar_t transBuf[KEYBOARD_BUFFER_SIZE]; - MSG msg; BYTE state[256]; DWORD bufsize = KEYBOARD_BUFFER_SIZE; @@ -211,8 +212,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead *buf++ = (unsigned char) rgdod[i].dwOfs; *buf++ = (unsigned char) rgdod[i].dwData; if (translationEnabled) { - while (PeekMessage(&msg, hwnd, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE) != 0) - ; // Flush keyboard messages to update keyboard state + handleMessages(); UINT virt_key = MapVirtualKey(rgdod[i].dwOfs, 1); if (virt_key != 0) { if (!GetKeyboardState(state))