diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-05 01:38:34 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-05 01:38:34 +0800 |
| commit | 7b35df871444842976e3b8389825f39a4267a270 (patch) | |
| tree | 11d3e8e10f6b5ba2d7484190fc43a9d06f038d8a /Minecraft.Client/Windows64/KeyboardMouseInput.cpp | |
| parent | ef66f6736dc0150c680afba4992b67970dbab992 (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.cpp')
| -rw-r--r-- | Minecraft.Client/Windows64/KeyboardMouseInput.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp index 7ab99a71..95c3f4fc 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.cpp +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.cpp @@ -33,6 +33,7 @@ void KeyboardMouseInput::Init() m_mouseDeltaAccumX = 0; m_mouseDeltaAccumY = 0; m_mouseWheelAccum = 0; + m_mouseWheelConsumed = false; m_mouseGrabbed = false; m_cursorHiddenForUI = false; m_windowFocused = true; @@ -67,6 +68,7 @@ void KeyboardMouseInput::ClearAllState() m_mouseDeltaAccumX = 0; m_mouseDeltaAccumY = 0; m_mouseWheelAccum = 0; + m_mouseWheelConsumed = false; } void KeyboardMouseInput::Tick() @@ -88,6 +90,7 @@ void KeyboardMouseInput::Tick() m_mouseDeltaY = m_mouseDeltaAccumY; m_mouseDeltaAccumX = 0; m_mouseDeltaAccumY = 0; + m_mouseWheelConsumed = false; m_hasInput = (m_mouseDeltaX != 0 || m_mouseDeltaY != 0 || m_mouseWheelAccum != 0); if (!m_hasInput) @@ -172,6 +175,8 @@ void KeyboardMouseInput::OnMouseWheel(int delta) int KeyboardMouseInput::GetMouseWheel() { int val = m_mouseWheelAccum; + if (val != 0) + m_mouseWheelConsumed = true; m_mouseWheelAccum = 0; return val; } |
