summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_win32.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/nativewindow_win32.cc')
-rw-r--r--plugingui/nativewindow_win32.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc
index 9f8936f..72e0598 100644
--- a/plugingui/nativewindow_win32.cc
+++ b/plugingui/nativewindow_win32.cc
@@ -411,7 +411,7 @@ void NativeWindowWin32::grabMouse(bool grab)
bool NativeWindowWin32::hasEvent()
{
MSG msg;
- return PeekMessage(&msg, nullptr, 0, 0, 0) != 0;
+ return PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE) != 0;
}
Event* NativeWindowWin32::getNextEvent()
@@ -431,4 +431,21 @@ Event* NativeWindowWin32::getNextEvent()
return event;
}
+Event* NativeWindowWin32::peekNextEvent()
+{
+ Event* event = nullptr;
+
+ MSG msg;
+ if(PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ event = this->event;
+ this->event = nullptr;
+
+ return event;
+}
+
} // GUI::