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