diff options
author | David Robillard <d@drobilla.net> | 2012-04-29 18:10:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-29 18:10:46 +0000 |
commit | d9732fbc106a6ac228912078888fbac65e78d26d (patch) | |
tree | d0b8c8f11c7cdcf8d117f853d680e4fa706d2a99 /pugl/pugl_win.cpp | |
parent | d4b2829de83ca5f0efd3d1ee2683ee400e63ffe2 (diff) | |
download | pugl-d9732fbc106a6ac228912078888fbac65e78d26d.tar.gz pugl-d9732fbc106a6ac228912078888fbac65e78d26d.tar.bz2 pugl-d9732fbc106a6ac228912078888fbac65e78d26d.zip |
Scroll support on Windows.
Diffstat (limited to 'pugl/pugl_win.cpp')
-rw-r--r-- | pugl/pugl_win.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp index 5441409..a3354bf 100644 --- a/pugl/pugl_win.cpp +++ b/pugl/pugl_win.cpp @@ -39,6 +39,10 @@ wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) return 0; case WM_DESTROY: return 0; + case WM_MOUSEWHEEL: + case WM_MOUSEHWHEEL: + PostMessage(hwnd, message, wParam, lParam); + return 0; default: return DefWindowProc(hwnd, message, wParam, lParam); } @@ -201,6 +205,18 @@ puglProcessEvents(PuglWindow* win) case WM_RBUTTONUP: processMouseEvent(win, 3, false, msg.lParam); break; + case WM_MOUSEWHEEL: + if (win->scrollFunc) { + win->scrollFunc( + win, 0, (int16_t)HIWORD(msg.wParam) / (float)WHEEL_DELTA); + } + break; + case WM_MOUSEHWHEEL: + if (win->scrollFunc) { + win->scrollFunc( + win, (int16_t)HIWORD(msg.wParam) / float(WHEEL_DELTA), 0); + } + break; case WM_KEYDOWN: case WM_KEYUP: if (win->keyboardFunc) { |