Enhanced Input System Mouse XY 2D Axis only registering input while holding down a Mouse Key

Hey there. Recently I started working on a simple system. Basically the player pawn has a Reticle component that moves along 2 Axis in front of the screen. However, a problem is that the reticle must be able to move across the screen using both Mouse and Gamepad to support both control methods. The issue is that when using Mouse XY 2D Axis as input, no movement will be registered until the player holds down a key. I tried everything I could imagine, and cannot find a way to make this system behave correctly.

1 Like

Mmmhhh, i have tested it, and for me, the Enhanced Input Mouse Action got triggered the moment, i start moving the mouse. This was my test setup:

Well I recently found the solution… Aparently, setting Show Mouse Cursor to True will disable the input of mouse movement unless a 2nd type of mouse input is detected. Really odd thing.

Really odd. I am not sure, if i have changed something in my test project regarding the mouse, but for me, it still registers the mouse inputs, if i show the mouse cursor.

Really? I’m using the 5.2 version, but I really don’t think it has something to do with that. Maybe the way I used a custom cursor?

My test project was in 5.2 too, so it must be something else. The real trouble is to get the visible mouse cursor recorded in a screenshot or video -.-´

For some reason, my recording software only shows a black silhouette after a recent update, instead the full colored version. But yeah, here i am switching the visibility on and off.
And why did Youtube made it just lousy 720p o.O

I really don’t know what could the reason be then. I didn’t do anything special with my project or Input settings.

I’m having the same problem. I’m making an RTS so I need the cursor to be visible.

There are other threads about this but I found no advice that worked. I tried Set input mode game and ui and set viewport mouse capture mode. None of them worked.

Have you come up with a solution?

mousemove is basically tick anyway so you could just use that or a timer to update

As Martiniano mentioned, disabling “Show Mouse Cursor” on the Player Controller seems to “fix” this for users that face this problem. Unfortunately, the mouse disappears. Using the “Set Show Mouse Cursor” node on “Get Player Controller” also triggers the bug.

I think Epic is aware of this. If you look at their “Cropout Sample Project” they work around this issue by registering Mouse Movement through the now deprecated Axis Mappings system. Almost everything else uses the new Enhanced Mapping system.

I am not sure why they have not fixed this since that project released but here is their own sample setup as a temporary workaround until fixed. Using the old system just for registering the mouse movement allows you to enable “Show Mouse Cursor” and trigger mouse movement events.

3 Likes

For what I have tested, an enhance input action on mouse move only triggers when the mouse moves. So any logic that’s needed on mouse movement runs only during mouse movement unlike in the tick.

And yes, I too stumbled across this issue today. I am on 5.3.

i have the exact problem as I’m using 5.3.2, I’m using it for my RTS game too and controlling my Camera movement Either in pawn or on Player Controller, unchecking “Show Mouse Cursor” and “Enable Click Events” On or Off won’t make the problem goes away and my mouse movement input only triggered when I click on a button on my mouse! it’s frustrating, the only solution now is to recall Mouse X/Y Directly in my Blueprint!

Edit: I have to bypass this line to be able to get it working only when “Show Mouse Cursor” is disabled

1 Like

It’s not a bug, it’s a feature.

Essentially when in Input Mode Game (default if you don’t change it) the mouse is hidden. Activating that “show mouse cursor” does A LOT MORE than just showing it.
It actually gives the capture of the mouse input to UI instead - making it unavailable to your current Input Game Mode. Which is why clicking in your game suddenly gives you the input capture back.
One workaround is to render a UUserWidget in your viewport on mouse location, and keep the mouse hidden.

2 Likes

In project I am building I have two InputMappingContext I swap between, one with ShowMouseCursor enabled and other disabled. I managed to fix the issue of needing to click after hiding the cursor by setting: SetINputMode(FInputModeGameOnly())

That seems like a much cleaner approach. I will keep that in mind for next time.

Did you set that on begin play, or when the Contexts are swapped? I would like to see the code…

Absolutely none of the discussion here address the underlying issue that the option Show Mouse Cursor in the PC’s mouse interface nullifies Delta Mouse (makes Delta Mouse XY zero) in all cases mentioned when the mouse is not held down. Just to repeat and be clear, none of your solution work when the cursor is visible and the mouse is NOT held. I tried them in a vanilla 3rd person just now one after the other… This basically makes using the built-in cursor a broken feature. Even the old system doesn’t work, contrary to what other people affirmed here. The only “work-around” for now is to use a widget cursor (set in project properties).

2 Likes

It’s a feature unfortunately, you need to understand what ShowMouseCursor is intended for and use it accordingly.

I do agree it’s counter-intuitive and you feel like you’d want to have input the Game Input Mode. But any engine is biased and some stuff is decided for you. Good thing we have access to the source code and can make any changes we want :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.