x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Get Focused Widget?

Theres no way to Get Focused Widget? I just found on widget blueprints the Has Focus node that only works if used with a constant check tick :'(

Product Version: UE 4.21
Tags:
more ▼

asked Nov 30 '18 at 08:06 PM in Blueprint Scripting

avatar image

Krakhat
16 3 6

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

1 answer: sort voted first

I think there is no method that will retrieve your focused widget, but if you are the owner of the method that is setting a widget in the viewport, you can always store a reference of the last widget on screen to work later with it.

As soon as you create a widget from Class, store the return value in a local variable, and then add it to the viewport.

I often do this, helps a lot in future developments.

more ▼

answered Nov 30 '18 at 08:55 PM

avatar image

leofucci
166 9 18 24

avatar image Krakhat Nov 30 '18 at 09:49 PM

I need get the focused widget from navigation with gamepad or keyboard, so the stored initial widget won't work for that usage, thanks anyway

avatar image SageX85 Dec 03 '18 at 05:48 PM

You can do it exactly like that, with a tick, the problem is, that you must have something like

Every tick "Does this have focus?" "No." "Does this have focus?" "No." "Does this have focus?" "No." "Does this have focus?" "Yes" Store focused into a variable, and every tick set your focus into the selected widget.

And you ask for every widget. If you dont want the mouse to change the focus, you override the on mouse button down function to set the focus in the stored focus.

It might not be the best way, thats for sure, but is one way to do it. Im also looking for a way to disable mouse click, and at the moment this is the best i have come. Still looking for a more optimal way to do it.

avatar image Krakhat Dec 04 '18 at 01:03 AM

I wrote for support asking to them add it as function, waiting they answer.

(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