aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Windows64/KeyboardMouseInput.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-05 01:38:34 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-05 01:38:34 +0800
commit7b35df871444842976e3b8389825f39a4267a270 (patch)
tree11d3e8e10f6b5ba2d7484190fc43a9d06f038d8a /Minecraft.Client/Windows64/KeyboardMouseInput.h
parentef66f6736dc0150c680afba4992b67970dbab992 (diff)
Fix controller paging regression in creative menu
Preserve smooth row-by-row scrolling for mouse wheel input, but restore full-page movement for controller/menu scroll actions in the creative inventory. Commit 3093ca3 changed page indexing to support smooth scrolling, which caused ACTION_MENU_OTHER_STICK_UP/DOWN to advance by one row instead of one page. Track whether the scroll action originated from the mouse wheel and only use single-row steps in that case. Fixes #253
Diffstat (limited to 'Minecraft.Client/Windows64/KeyboardMouseInput.h')
-rw-r--r--Minecraft.Client/Windows64/KeyboardMouseInput.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.h b/Minecraft.Client/Windows64/KeyboardMouseInput.h
index f098ccab..05067055 100644
--- a/Minecraft.Client/Windows64/KeyboardMouseInput.h
+++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h
@@ -59,7 +59,8 @@ public:
int GetMouseWheel();
int PeekMouseWheel() const { return m_mouseWheelAccum; }
- void ConsumeMouseWheel() { m_mouseWheelAccum = 0; }
+ void ConsumeMouseWheel() { if (m_mouseWheelAccum != 0) m_mouseWheelConsumed = true; m_mouseWheelAccum = 0; }
+ bool WasMouseWheelConsumed() const { return m_mouseWheelConsumed; }
// Per-frame delta consumption for low-latency mouse look.
// Reads and clears the raw accumulators (not the per-tick snapshot).
@@ -114,6 +115,7 @@ private:
int m_mouseDeltaAccumY;
int m_mouseWheelAccum;
+ bool m_mouseWheelConsumed;
bool m_mouseGrabbed;