I’m not able to get my keyboard with my widgets.
When I press on the down arrow, I can see that it detects the keypress, but nothing happens on the widget itself.
Then when I click on it, there’s an effect (it registers the click properly). AFTER that, I can use the arrow keys and the widget menu also seems to read that (eg. the faint blue outline moves up and down).
BUT, after that, the button press is registered only when I hit enter. Nothing happens when I hit X, which is supposed to be my assigned selection button. (eg. When I hit enter, it reads the button in question eg “End” or “Action” but when I press X on the keyboard, it just reads the keypress and there is no effect on the menu itself.
I am having a lot of trouble understanding what I’ve done wrong. Any help would be appreciated.
If I’m understanding the issue and the goal properly…
You may have make an integer variable to track current selection and handle visual indication of which one is active yourself. On buttons there isn’t a (visual) focused state. There’s normal, hover, pressed.
When you click the button it gets focus and using the keys makes that blue outline appear. I’m not sure exactly the point of the blue outline. Some kind of accessibility thing that never seemed particularly useful. Probably like what you get tabbing through links on a website. It doesn’t trigger a hover state, just some accessibility line.
The main issue I am facing is that the widget only responds to pre-defined keysets (eg. arrow keys to move up and down between buttons, and enter and space to select/ click (press the button)). Instead of these keys, I would like to remap to another set of keys as defined through “Enhanced Input Action”. I’m not able to figure out how to override the default/ generic arrow keys and enter key setup through blueprints… or do I need to hard code this setup in C++?
If I need a widget to respond to keys I usually override the On Preview Key Down function. As long as the widget has focus it should respond to whatever key logic you make in there.
I wouldn’t rely on the built-in logic, the one that outlines the buttons.
You can probably use Enhanced Input Action somehow. I don’t bother with that for widgets personally.