I Can't set mouse wheel to input key selector

Hello,

I’m doing and widget with settings to allow the player to bind some input he wants. Everything works fine expect for the mouse wheel input and the gamepad left thumb stick to move the character.

I guess it’s because all of these inputs it’s using inside the widget to navigate into it. But I don’t know how to solve my problem. Anyone else got this issues ? I only see other subjects without any good answer. The game is supposed to be played by other gamer so I have to allow remapping with all inputs

No, it doesn’t work. Apparently this is a workaround:

If you are willing to modify the engine, you can avoid awkward Blueprint workarounds by modifying two files and solving it the “right” way. It was relatively straightforward to figure out how to do this since similar functions already existed, so my guess is this is indeed an oversight by Epic and I’m not sure how it hasn’t been patched yet (surely they ran into it themselves in their own games?)

The solution:

Put this:

SLATE_API virtual FReply OnMouseWheel(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;

…into SInputKeySelector.h inside the SInputKeySelector class, preferably next to the other ‘OnKeyDown’ esque functions. Then, in SInputKeySelector.cpp:

FReply SInputKeySelector::OnMouseWheel(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
FKey MouseWheelKey = MouseEvent.GetWheelDelta() > 0 ? FKey(EKeys::MouseScrollUp) : FKey(EKeys::MouseScrollDown);
EModifierKey::Type ModifierKey = EModifierKey::FromBools(
MouseEvent.IsControlDown() && MouseWheelKey != EKeys::LeftControl && MouseWheelKey != EKeys::RightControl,
MouseEvent.IsAltDown() && MouseWheelKey != EKeys::LeftAlt && MouseWheelKey != EKeys::RightAlt,
MouseEvent.IsShiftDown() && MouseWheelKey != EKeys::LeftShift && MouseWheelKey != EKeys::RightShift,
MouseEvent.IsCommandDown() && MouseWheelKey != EKeys::LeftCommand && MouseWheelKey != EKeys::RightCommand );

// Don’t allow chords consisting of just modifier keys.
if ( bIsSelectingKey && (bAllowGamepadKeys || MouseWheelKey.IsGamepadKey() == false) && ( MouseWheelKey.IsModifierKey() == false || ModifierKey == EModifierKey::None ) )
{
SetIsSelectingKey( false );

  if (bEscapeCancelsSelection && (MouseWheelKey == EKeys::Escape || IsEscapeKey(MouseWheelKey)))
  {
  	return FReply::Handled();
  }

  SelectKey(
  	MouseWheelKey,
  	ModifierKey == EModifierKey::Shift,
  	ModifierKey == EModifierKey::Control,
  	ModifierKey == EModifierKey::Alt,
  	ModifierKey == EModifierKey::Command);
  return FReply::Handled();

}
else if (!bIsSelectingKey && Button.IsValid())
{
return Button->OnMouseWheel(MyGeometry, MouseEvent);
}

return SCompoundWidget::OnMouseWheel(MyGeometry, MouseEvent);
}

I just tested it now and it seems to work fine, I may have overlooked some details but it gets the job done