aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.h')
-rw-r--r--win32/PlatWin.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/win32/PlatWin.h b/win32/PlatWin.h
index 893618b38..68098f9c7 100644
--- a/win32/PlatWin.h
+++ b/win32/PlatWin.h
@@ -49,6 +49,20 @@ int SystemMetricsForDpi(int nIndex, UINT dpi) noexcept;
HCURSOR LoadReverseArrowCursor(UINT dpi) noexcept;
+class MouseWheelDelta {
+ int wheelDelta = 0;
+public:
+ bool Accumulate(WPARAM wParam) noexcept {
+ wheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam);
+ return std::abs(wheelDelta) >= WHEEL_DELTA;
+ }
+ int Actions() noexcept {
+ const int actions = wheelDelta / WHEEL_DELTA;
+ wheelDelta = wheelDelta % WHEEL_DELTA;
+ return actions;
+ }
+};
+
#if defined(USE_D2D)
extern bool LoadD2D();
extern ID2D1Factory *pD2DFactory;