From cb2b532f708b343fd5a80e24f52662e30e05a6b0 Mon Sep 17 00:00:00 2001 From: MrTheShy <49885496+MrTheShy@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:10:26 +0100 Subject: [PATCH] Fix creative inventory scroll for both mouse wheel and controller The mouse scroll wheel was not working in the creative inventory at all. UIController remaps wheel input from OTHER_STICK to UP/DOWN for KBM users, but the base container menu handler consumed UP/DOWN for grid navigation before it could reach the creative menu's page scrolling logic in handleAdditionalKeyPress. Fixed by detecting scroll wheel input on UP/DOWN in the base handler and forwarding it as OTHER_STICK to handleAdditionalKeyPress instead. Also fixed the controller right stick scrolling way too fast: it was jumping TabSpec::rows (5) rows per tick at 100ms repeat rate, which blew through the entire item list almost instantly. Reduced to 1 row per tick so scrolling feels controlled on both input methods. --- .../Common/UI/IUIScene_AbstractContainerMenu.cpp | 14 ++++++++++++++ .../Common/UI/IUIScene_CreativeMenu.cpp | 16 ++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp index 882584211..37ef0233c 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp @@ -1486,12 +1486,26 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b } break; case ACTION_MENU_UP: +#ifdef _WINDOWS64 + if (g_KBMInput.WasMouseWheelConsumed()) + { + handleAdditionalKeyPress(ACTION_MENU_OTHER_STICK_UP); + break; + } +#endif { //ui.PlayUISFX(eSFX_Focus); m_eCurrTapState = eTapStateUp; } break; case ACTION_MENU_DOWN: +#ifdef _WINDOWS64 + if (g_KBMInput.WasMouseWheelConsumed()) + { + handleAdditionalKeyPress(ACTION_MENU_OTHER_STICK_DOWN); + break; + } +#endif { //ui.PlayUISFX(eSFX_Focus); m_eCurrTapState = eTapStateDown; diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 0d3f7dace..56aaf2591 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -1099,13 +1099,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction) break; case ACTION_MENU_OTHER_STICK_DOWN: { - int pageStep = TabSpec::rows; -#ifdef _WINDOWS64 - if (g_KBMInput.WasMouseWheelConsumed()) - { - pageStep = 1; - } -#endif + int pageStep = 1; m_tabPage[m_curTab] += pageStep; if(m_tabPage[m_curTab] >= specs[m_curTab]->getPageCount()) { @@ -1119,13 +1113,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction) break; case ACTION_MENU_OTHER_STICK_UP: { - int pageStep = TabSpec::rows; -#ifdef _WINDOWS64 - if (g_KBMInput.WasMouseWheelConsumed()) - { - pageStep = 1; - } -#endif + int pageStep = 1; m_tabPage[m_curTab] -= pageStep; if(m_tabPage[m_curTab] < 0) {