Hello folks, i’m writing this post because it seems there isn’t a valid solution for me.
I’m working on a RTS, and i need to have the mouse cursor always visible and locked in the window.
Here’s my code in my custom player controller constructor:
bShowMouseCursor = true;
bEnableClickEvents = true;
bEnableMouseOverEvents = true;
DefaultMouseCursor = EMouseCursor::Hand;
Now i found some behaviours that i think are a bit wrong:
- if visible, the mouse is free go out of the viewport, even maintaining the focus.
- the mouse looks like the default arrow, instead of the hand
- the mouse is lock in the viewport and assumes the Hand look ONLY if i press a button
- all this applies both in PIE and standalone mode.
I started from an empty code project, just created a custom game mode (still empty) and player controller (excepting for this code, still empty too).
Seems the only working solution for the mouse locking issue out there is to use the mouse lock from a slate widget, but we would like to use UMG so that’s not applicable.
ATM, i think we could keep the mouse not visible and draw a cursor manually on the hud, but i’m writing this to know if there are solutions and/or to know if those are bugs.