Using Key Event Navigation Direction

I want a widget to detect whenever a navigation key is being pressed. For example is the left, right, up, down keys on the keyboard. I saw these two nodes and it seems like these are the closest nodes that I can use but I don’t know which node to plug it to.

Like if I use Any Key node, how can I make the Key to connect to Get Key Event Nav Direct?

Hello @Akimikage ,Welcome to the forums!
You could try the following:

First, enable Is Focusable on the Widget.


Then, when you create it, add a Set Keyboard Focus node right after Add to Viewport so the widget can receive keyboard input.

Next, in the Widget Blueprint, override the On Key Down function and implement the logic shown in the image. The Print String nodes are just there to verify that the event is firing correctly when you press the navigation keys.

Finally, connect a Handled node to the Return Value to indicate that the widget has consumed the event.

With that setup, it should correctly detect the keys (Left, Right, Up, Down, etc.).

Hope it helps