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"

Hide the mouse cursor in a UMG menu when a gamepad is used

I have menu system created in UMG. It allows mouse, keyboard and gamepad inputs. The thing is, I would like the mouse cursor to disappear when a gamepad is in use. To me it seems logical to test a keypress and check if that came from a gamepad or not. If it does, hide the mouse cursor!

I am using a function override called OnKeyDown: OnKeyDownBlueprint

Now I am probably missing something or there is something I don't understand! When navigating the menu with a gamepad the left stick and d-pad moves the focus field around to the individual buttons and the 'face button down' is used to "click" on a button. This override function works with all the other keys, but not the ones used to control the menu.

Is there a way to do a similar check on the left stick, d-pad and 'face button down' in a widget blueprint (or include them in this function)? Or is there another way to do this?

Product Version: UE 4.14
onkeydown.png (95.8 kB)
more ▼

asked Feb 05 '17 at 10:05 PM in Blueprint Scripting

avatar image

557 18 24 41

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Okay, so now I feel really stupid!

OnPreviewKeyDown and Unhandled did the trick:

alt text

I find the answer to something shortly after posting a question about it. I really should ask a LOT more questions!!! :)

more ▼

answered Feb 06 '17 at 12:29 AM

avatar image

557 18 24 41

(comments are locked)
10|2000 characters needed characters left

To Hide the mouse cursor you can use "Set Show Mouse Cursor"

more ▼

answered Feb 05 '17 at 10:49 PM

avatar image

36 3 3

avatar image Fjellgnu Feb 05 '17 at 11:02 PM

Yes, I know. My problem is how to include ALL the keys on the gamepad when I check which buttons are pressed!

The function in my screenshot is just checking unused buttons, unfortunately. :(

Thanks for answering!

(comments are locked)
10|2000 characters needed characters left
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