Explorar o código

* GetKeyEventFromQueueWait waits always till it gets an event

git-svn-id: trunk@9203 -
florian %!s(int64=18) %!d(string=hai) anos
pai
achega
b7cce59ac7
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      rtl/win/keyboard.pp

+ 4 - 1
rtl/win/keyboard.pp

@@ -122,7 +122,10 @@ begin
       exit;
     end;
   WaitForSingleObject (newKeyEvent, dword(INFINITE));
-  getKeyEventFromQueueWait := getKeyEventFromQueue (t, false);
+  { force that we read a keyevent }
+  while not(getKeyEventFromQueue (t, false)) do
+    Sleep(0);
+  getKeyEventFromQueueWait:=true;
 end;
 
 { translate win32 shift-state to keyboard shift state }