How to Control UI By Keyboard Buttons And Gamepad

I have 4 different widgets for now, which have total of 16 buttons 3 checkboxes and 2 sliders.
For now i just change values of these components with my mouse only, but i also want to change them with my keyboards arrow keys and also gamepads dpad or one of the thumbsticks.
I found 2 approaches to this subject in the forums, one of them is a free plugin which seems okay but only works with button components and even if it works with other components i will need to make widgets from scratch again and i really dont want to do it.
The other one is creating a player controller and a gamemode for only this subject which works in levels like main menu that you dont need a input for player but that wont work in playable levels which you will need your own gamemode.
So can i acces to enhanced input from widgets? And use the same input keys that i use on my normal game for widgets, for example for in game menu i can pause the game and use dpad for going between buttons then close the widget and keep playing the normal game.

Not sure I follow, this is already supported out of the box on widget level, without EI. Any widget has navigation rules you are free to override:

And any user widget can override onKeyDown / onAnalogueValueChanged; while buttons will accept input without overrides - like the spacebar, for example. I believe the gamepad’s x button is also there by default, but don’t quote me on that.


To answer this directly - yes, ofc! It’s a matter of granting widgets Keyboard Focus:

They can then process input natively or via the Enhanced Input.

1 Like

Oh, didnt know that, thats my bad, bad googling it seems.

I can’t recall for sure, but it’s somewhat undocumented or documented poorly. Examples are scarce, but there might be something solid out there in the tutorial section or even YT :person_shrugging:

1 Like