Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.7
more ▼

asked May 17 '15 at 03:09 PM in Blueprint Scripting

avatar image

108 16 25 28

avatar image Kavas May 20 '15 at 12:30 AM

Relevant to my interests. Working on this now, and noticed the same thing. When a button has keyboard focus, it gets that dotted white outline around it, and if it is pressed via a controller/keyboard the pressed color works. However, if a button has keyboard focus it does not have the hovered color. I tried briefly to play around with it in blueprints.

alt text

I tried setting the hovered color of a button in my array of buttons within blueprint. I can confirm given the options of 'make buttonstyle' node if I set the color on Normal or Pressed the color comes through on the button, however, Hovered still remains neutral. If I move my mouse over the button, the hover color is there.

So how can we get a keyboard focused button to have the same effect as if the mouse was focused on it? Seems like this may be a bug.

Also, while were on topic, how can I change the dotted white outline of the button when a button has keyboard focus?

I'll keep playing around with it, but it may be a bug.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

alt text

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. >.<"

highlightcolor.png (205.3 kB)
more ▼

answered Aug 01 '15 at 11:18 PM

avatar image

18 3 5 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

this goes in the event graph of each widget blueprint

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.)

more ▼

answered Oct 28 '17 at 05:38 PM

avatar image

1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question