From 84cf67a8f4a4374acd8aaaa5e41ff0f26a708d76 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 14 Jan 2016 20:47:01 -1000 Subject: [PATCH 1/2] Win32 WM_MOUSEHWHEEL added --- LogVisor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LogVisor b/LogVisor index e7478c5..55b81ec 160000 --- a/LogVisor +++ b/LogVisor @@ -1 +1 @@ -Subproject commit e7478c5bb49b6d896827581d58929469fc405e21 +Subproject commit 55b81ec091e9f0e57bd7d092a396916234b1ada5 From 056eef542b114656de55e8fa5e27fddcfb673ce5 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 14 Jan 2016 20:46:15 -1000 Subject: [PATCH 2/2] Add horizonal mousewheel scrolling --- lib/win/ApplicationWin32.cpp | 1 + lib/win/WindowWin32.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/win/ApplicationWin32.cpp b/lib/win/ApplicationWin32.cpp index 951f979..7b57540 100644 --- a/lib/win/ApplicationWin32.cpp +++ b/lib/win/ApplicationWin32.cpp @@ -269,6 +269,7 @@ public: case WM_MOUSEHOVER: case WM_NCMOUSEHOVER: case WM_MOUSEWHEEL: + case WM_MOUSEHWHEEL: case WM_CHAR: case WM_UNICHAR: window->_incomingEvent(&HWNDEvent(uMsg, wParam, lParam)); diff --git a/lib/win/WindowWin32.cpp b/lib/win/WindowWin32.cpp index e02ac1e..6af847d 100644 --- a/lib/win/WindowWin32.cpp +++ b/lib/win/WindowWin32.cpp @@ -1190,6 +1190,24 @@ public: } return; } + case WM_MOUSEHWHEEL: + { + if (m_callback) + { + int x, y, w, h; + getWindowFrame(x, y, w, h); + SWindowCoord coord = + { + { GET_X_LPARAM(e.lParam), h-GET_Y_LPARAM(e.lParam) }, + { GET_X_LPARAM(e.lParam), h-GET_Y_LPARAM(e.lParam) }, + { float(GET_X_LPARAM(e.lParam)) / float(w), float(h-GET_Y_LPARAM(e.lParam)) / float(h) } + }; + SScrollDelta scroll = {}; + scroll.delta[0] = GET_WHEEL_DELTA_WPARAM(e.wParam) / double(-WHEEL_DELTA); + m_callback->scroll(coord, scroll); + } + return; + } case WM_CHAR: case WM_UNICHAR: {