I am working on an RTS and I need to be able to show the cursor permanently but showing the cursor makes it so that I can’t get the cursor position using enhanced inputs mouse movement. This problem can be easily replicated in a blank project by the following steps:
- In the blank project, create a gaming mode and player controller and set them up as defaults.
- Create an input action and mapping context for the
Mouse XY 2D-Axis
. - Set up the player controller blueprint like the following.
Removing the connector before setting the mouse cursor and moving the mouse, displays “Foo”. But if show mouse cursor is turned on, no matter what game setting is applies, I can’t get “Foo” to be printed without holding down a mouse button.
I have seen some posts which talks about how to workaround things using CommonUI but since I haven’t started working on the UI, I was looking for an alternative way.
This is probably a question that has been asked a lot, but I haven’t really seen a good answer, or the answers are for pre 5.0 like here. So, asking the question again.