I am trying to include full gamepad (XBox one controller) support. I would like to have a cursor controlled by the left thumbstick and the “a” button (gamepad face bottom) to select (generate a click). Very similar to Destiny’s menu system if you are familiar with the game. I have just set my controls in blueprint to control the mouse cursor with the thumbstick relatively easily. I thought that would be the hard part but apparently generating a click is the real issue.
This is a very similar issue:
In the potential solution above, the line trace will not fire the on pressed event of the button. Even if the line trace correctly finds the button, how do I go about “pressing” it with a reference to the object?
Here are some other potential solutions I would like to pass by the unreal experts here:
-
Can I get mouse position, get current visible widget element underneath it, cast to button and somehow fire the onpressed?
-
Another option is on mouse hover to set the current control. Then Gamepad face bottom (A) will fire the onpressed event on the current control.
-
Can I expose C++ code to generate a mouseclick? I exposed the SetMouse() function for gamepad mouse movement but I’ve thoroughly combed through the list of functions and couldn’t see anything that looked like it would generate a click.
The biggest issue here is that I can’t manually fire off the onpressed event in any way other than an actual click or touch to my knowledge.
Another issue:
Mouse controls will be killed if/when this game is exported to Xbox, correct? Xbox does not have mouse support? I can absolutely emulate a “virtual” mouse with some interface work but this is something I would like to consider when picking a solution.
Please help me out!!! This is hurting my brain and I will liberally be handing out +1s to anyone can offer constructive ideas or solutions.
Thank you so much in advance!