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.
This commit is contained in:
MrTheShy 2026-03-06 19:10:26 +01:00
parent 129223d502
commit cb2b532f70
2 changed files with 16 additions and 14 deletions

View file

@ -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;

View file

@ -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)
{