ISKs are a widget used for menus where a player can remap the game’s controls. It has 2 bindable events, OnIsSelectingKeyChanged for when a user clicks on it, and OnKeySelected when a user presses the new key that want to change the game action to.
It's known they don't detect Mouse Wheel Up/Down/Axis events and I'm wondering if there's a way to bypass it. I don't really feel like making my own ISK from scratch.
Atm my blueprints are set up so when OnIsSelectingKeyChanged is triggered it listens for mouse wheel inputs. My current issue is once OnIsSelectingKeyChanged is fired there is no way to make the widget end displaying the Key Selection Text (default “…”) and listening for a valid keypress.
Things I have tried:
Using “Set Selected Key”. This only works when the ISK widget hasn’t been clicked
Binding an event dispatcher to OnKeySelected - the event is “pure/latent” and is unbindable. Even if you drag off from it and select one of the contextual binding options it throws an error on compile.
Using mouse wheel as an Escape key. This does fire OnKeySelected but it doesn’t behave like it does with normal Escape Keys. The widget keeps displaying the Key Selection Text and awaiting a valid input. I can tell OnKeySelected to execute Set Selected Key and set it to a mouse wheel input, but this doesn’t stop the widget from awaiting a keyboard stroke or mouse click.
Simulating a keyboard stroke. I am unable to find any info on this. Many past topics on it centered around someone wanting to know it because they’ve used an Input Event in place of a Custom Event, whose solution is to not simulate a key stroke.
In the widget blueprint, create both events for the Key Selector and one custom function with a bool input (Set Mouse Wheel), and create one bool variable (Is Pressed):
Set Focus to the parent forces the On Is Selecting Key Changed to fire again and subsequently call the On Key Selected event. I haven’t found another way to force call this event, so if someone knows how to do that without changing focus, feel free to comment on that.
I believe everything else should be quite clear.
The overridden function may conflict with the default scrolling function; Frankly, I didn’t check that.
Looks like it’s still not fixed.
In Lyra starter game Epic doesn’t even use InputKeySelector, they just show you full screen overlay and capturing keys with something like AnyKeyEvent I guess
It works but there’s still the problem of how to apply it to multiple key selectors, doesn’t seem to be a way to detect which key selector is currently being used
Make your key selector into a separate widget blueprint (let’s call it WBP_MyKeySelector), and I use this widget instead of a key selector. Then you can create a delegate/event in that new widget with WBP_MyKeySelector object as a parameter, and subscribe to it from the parent widget that listens to mouse wheel inputs.
In the new widget, subscribe to the key selector’s OnIsSelectingKeyChanged event, and when it fires, broadcast the custom you’ve created, with Self as an input. This way your parent widget will obtain the reference to the key input widget that’s currently active.