But when i test it. i can display all key except the key [Left, Right, Up, Down].
And i don’t know why.
Any idea why some key doesn’t response?
Inside the Widget, i open a widget switcher where i put another widget with the same logic… and there i have all the key write 2 times on the screen except for the arrow [left, up, right, down] i have them only 1 time…
So why those key doesn’t response in the first widget, and respond in the second widget?
My bet is that those missing keys are responsible for keyboard navigation and something eats up that input. If you place 2 buttons side by side:
You can highlight them with arrows and enter evokes a button press. Since that input was used up - consumed by the button, it no longer propagates and the keydown cannot see it.
Hard to tell more without seeing the hierarchy of the widget doing this.
But it prints all keys, even ESC. There may be more to your setup that we’d to need to know about - not sure what to ask, though. Or there’s something special about UE5.
The arrows, enter and spacebar do not seem like a coincidence, almost sure. Widgets use them for keyboard navigation:
So, in a nutshell:
The MainUI widget (with Widget switcher) doest not process arrow keys + enter
The Press_Start widget is happy to process arrow keys + enter
Pres_Start is inside the MainUI in the Switcher component.
I will try to set the Event BegingPlay like you to see if there is any impact.
So it’s the switcher that messes it up and that’s with only a single widget in the switcher, right? And you want to process input in the widget the switcher holds.
Added the input processing widget to the switcher:
In fact on my second widget (Inside the switcher) i had also the “Is Focusable = true”
I put false, because it was already on the MainUi… and there it work even with images…
I put back true, and now it works normally and i can’t reproduce it anymore…
Do we need to set all “Is Focusable” on all sub widget (Those inside the Switcher) ?
Or only on the main one is enough?
You need isFocusable on the very widget that has onKeyDown implemented, only.
Those inside the Switcher
If that’s the widget that is supposed process input, it must be keyboard focusable. Its parent does not matter.
Its parent does not matter.
It may - there may be an edge case scenario where you want to process input in the child, pass Unhandled, and then process it again in the parent widget.