This may seem like a dumb question but I can’t figure it out for the life of me.
What I’m trying to do is have the UI give visual feedback when a buton is pressed on the keyboard. For instance; The player presses the “F” key and the UI button lights up indicating they are attacking.
Is there a way to triggers the button being pressed by binding it to an input mapping? I feel like every game on earth does this to some extent and I don’t know why I can’t tell the button to be pressed in code.
I trying to keep everything in C++ as I am focusing on learning it. Thanks in advanced!
Neil
I think there is a misunderstanding. What I want is a umg button to register as pressed like a click when I press a key on the keyboard.
For instance I press “f” and the menu ui button that says “attack” gets lighter. I want to bind the input action to a ui button not just bind the input action to a function
A great example is when you press the “b” button on a game pad while in a menu and the ui element that says “B - back” lights up before executing the action of going back.
You can use ListenForInputAction in your UUserWidget Button to register a callback. You will still need to write the function to set the hilight state, regardless. Make sure you read the doc I posted above so you are familiar with how the input priority is handled.