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:
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?
Okay, so now I feel really stupid!
OnPreviewKeyDown and Unhandled did the trick:
I find the answer to something shortly after posting a question about it. I really should ask a LOT more questions!!! :)
answered Feb 06 '17 at 12:29 AM
To Hide the mouse cursor you can use "Set Show Mouse Cursor"
answered Feb 05 '17 at 10:49 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here