aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-27 17:21:17 +0000
committerDavid Robillard <d@drobilla.net>2014-01-27 17:21:17 +0000
commit1bfd6ea8ffe07d7e57ff47c228e04b62e1eb5317 (patch)
tree38286df5802464235ee5b34fb129a0db02ccee9e
parent69be0a7d6ed810faf6d5090c826df72c58b874f3 (diff)
downloadpugl-1bfd6ea8ffe07d7e57ff47c228e04b62e1eb5317.tar.gz
pugl-1bfd6ea8ffe07d7e57ff47c228e04b62e1eb5317.tar.bz2
pugl-1bfd6ea8ffe07d7e57ff47c228e04b62e1eb5317.zip
Fix event timestamps on win32, probably.
Fix horizontal scroll events on win32, maybe.
-rw-r--r--pugl/pugl_win.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp
index d72dc83..47ba18e 100644
--- a/pugl/pugl_win.cpp
+++ b/pugl/pugl_win.cpp
@@ -113,8 +113,6 @@ puglCreate(PuglNativeWindow parent,
SetWindowLongPtr(impl->hwnd, GWL_USERDATA, (LONG)view);
#endif
- SetWindowLongPtr(impl->hwnd, GWL_USERDATA, (LONG)view);
-
impl->hdc = GetDC(impl->hwnd);
PIXELFORMATDESCRIPTOR pfd;
@@ -291,6 +289,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_MOUSEWHEEL:
if (view->scrollFunc) {
+ view->event_timestamp_ms = GetMessageTime();
view->scrollFunc(
view, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam),
0.0f, (int16_t)HIWORD(wParam) / (float)WHEEL_DELTA);
@@ -298,17 +297,18 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_MOUSEHWHEEL:
if (view->scrollFunc) {
+ view->event_timestamp_ms = GetMessageTime();
view->scrollFunc(
view, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam),
- 0.0f, (int16_t)HIWORD(wParam) / float(WHEEL_DELTA));
+ (int16_t)HIWORD(wParam) / float(WHEEL_DELTA), 0.0f);
}
break;
case WM_KEYDOWN:
- view->event_timestamp_ms = (GetMessageTime());
if (view->ignoreKeyRepeat && (lParam & (1 << 30))) {
break;
} // else nobreak
case WM_KEYUP:
+ view->event_timestamp_ms = GetMessageTime();
if ((key = keySymToSpecial(wParam))) {
if (view->specialFunc) {
view->specialFunc(view, message == WM_KEYDOWN, key);