aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.h
diff options
context:
space:
mode:
authorZufu Liu <unknown>2022-10-23 08:45:52 +1100
committerZufu Liu <unknown>2022-10-23 08:45:52 +1100
commitff043e669aabcfbc71180fde97c9ef28bfe01c02 (patch)
treeadaedbe69f50af639539993e5a1920bf9c49cb5f /win32/PlatWin.h
parent758ee3666b0ee5b1adc91c269ec845f9db6f8dea (diff)
downloadscintilla-mirror-ff043e669aabcfbc71180fde97c9ef28bfe01c02.tar.gz
Feature [feature-requests:#1457] Reuse MouseWheelDelta for autocompletion lists.
This code triggers when wheel rotated and mouse is outside list.
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;