How to change UMG button image when button Has Keyboard Focus?
When navigating through UMG buttons using Arrow keys, Hovered image won't appear, but when moving mouse cursor over buttons Hovered image appears appropriately.
Is this a bug or is their any other way to achieve Hovered image when button Has Keyboard Focus?
asked May 17 '15 at 03:09 PM in Blueprint Scripting
I think this may be what you're looking for. I had a problem with this myself. You should think of the mouse as the "default" controller for unreal engine and the umg, and keyboard is secondary. So what you want to do is, use an OR boolean that you can find by right clicking and just typing in "or". I know this is an old question, but this may be useful to someone new who stumbles upon this question.
This is how I did mine. I know it's kind of messy, but I like to have all my nodes close together once I'm finished with them, instead of all scattered about. I made custom events like "Highlight..." and attached to them to Event Tick because else it won't work. I'm bad at explaining Unreal things, but basically, "Has keyboard focus" is for the keyboard, and is Hovered is for the Mouse. When either of these (OR boolean) are occuring, then set the color to red. If the button is not being hovered over, or does not have keyboard focus, then set the color to white. Do you understand? If you have any trouble understanding then just comment back. I'll try my best to explain some more. >.<"
answered Aug 01 '15 at 11:18 PM
Wanted to post this in case anybody else out there was looking for a solution that doesn't have to update every tick, and that can be pasted into many widgets and reused!
The widget BP's event construct node is off to the left. All of this spaghetti should come out of that node.
For each unique widget, you will have to change the array to include all buttons in that widget that are focusable. (There's no doubt a better way of doing this than plugging each individual button into the array, haha.)
Follow this question
Once you sign in you will be able to subscribe for any updates here