diff options
author | Stefan Westerfeld <stefan@space.twc.de> | 2019-06-23 16:21:15 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-24 01:02:52 +0200 |
commit | 9d127e389aa182f5d75395a59b3ba7241575f525 (patch) | |
tree | 6edec70b0538845a8179c00a269fc1c2af2477d9 /pugl/pugl_win.c | |
parent | b0ddcbba56b8fc6f1576553c805b5dc7185773e4 (diff) | |
download | pugl-9d127e389aa182f5d75395a59b3ba7241575f525.tar.gz pugl-9d127e389aa182f5d75395a59b3ba7241575f525.tar.bz2 pugl-9d127e389aa182f5d75395a59b3ba7241575f525.zip |
Represent event time as double in seconds on all platforms
Diffstat (limited to 'pugl/pugl_win.c')
-rw-r--r-- | pugl/pugl_win.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c index af32210..e9fecac 100644 --- a/pugl/pugl_win.c +++ b/pugl/pugl_win.c @@ -457,7 +457,7 @@ initMouseEvent(PuglEvent* event, ReleaseCapture(); } - event->button.time = (uint32_t)GetMessageTime(); + event->button.time = GetMessageTime() / 1e3; event->button.type = press ? PUGL_BUTTON_PRESS : PUGL_BUTTON_RELEASE; event->button.x = GET_X_LPARAM(lParam); event->button.y = GET_Y_LPARAM(lParam); @@ -473,7 +473,7 @@ initScrollEvent(PuglEvent* event, PuglView* view, LPARAM lParam) POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; ScreenToClient(view->impl->hwnd, &pt); - event->scroll.time = (uint32_t)GetMessageTime(); + event->scroll.time = GetMessageTime() / 1e3; event->scroll.type = PUGL_SCROLL; event->scroll.x = pt.x; event->scroll.y = pt.y; @@ -518,7 +518,7 @@ initKeyEvent(PuglEvent* event, PuglView* view, bool press, LPARAM lParam) ScreenToClient(view->impl->hwnd, &rpos); event->key.type = press ? PUGL_KEY_PRESS : PUGL_KEY_RELEASE; - event->key.time = (uint32_t)GetMessageTime(); + event->key.time = GetMessageTime() / 1e3; event->key.state = getModifiers(); event->key.x_root = rpos.x; event->key.y_root = rpos.y; @@ -638,7 +638,7 @@ handleCrossing(PuglView* view, const PuglEventType type, POINT pos) type, view, 0, - (uint32_t)GetMessageTime(), + GetMessageTime() / 1e3, (double)pos.x, (double)pos.y, (double)root_pos.x, @@ -740,7 +740,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) ClientToScreen(view->impl->hwnd, &pt); event.motion.type = PUGL_MOTION_NOTIFY; - event.motion.time = (uint32_t)GetMessageTime(); + event.motion.time = GetMessageTime() / 1e3; event.motion.x = GET_X_LPARAM(lParam); event.motion.y = GET_Y_LPARAM(lParam); event.motion.x_root = pt.x; |