Axis mappings for mouse X or Y return 0 after 1st mouseup

I have a very small, stripped down application that simply has axis mappings for mouse X and mouse Y, and each InputAxis event just prints out the Axis Value continuously. This is in the Event Graph of a child BP of class Character.

In the editor, it prints out delta X and Y as I move the mouse around the screen; if I press the mouse, it continues to work. But as soon as I release the mouse, both axis mappings return 0 for Axis Value until the program is exited – clicking the mouse more does nothing, moving it does nothing, I only get 0.

It’s worse if I build an app – that starts broken, with 0 Axis Values all the time.

This happened when I ported to 4.11 from 4.10.4 on a mac. It works fine in 4.10.4.

The zip file of my project is only 381k, so I’ll attach it right here

Hi Brian,
I am having the same issue, there is already a topic for this at Show mouse cursor disables mouse events - Programming & Scripting - Unreal Engine Forums
There has been a report (UE-28811) already raised so hopefully it will be fixed in the next update.

Same problem here on Win7 x64.

I am facing the same issue. After updating to 4.11 from 4.10.4 (which I had to do due to another bug), the MouseX/Y events are constantly returning 0. I can’t even get it to return anything else if I start the app from the editor. (Win10 x64)

I have a similar issue that occurs whenever I play in editor. Although I have the cursor hidden (1st person game), it’s clear that the mouse XY events return 0.0 whenever the cursor hits the sides of the viewport. If the cursor is not hitting the sides of the viewport, the mouse values are normal. This goes away after a single mouse click.

The link above does not work for me, so If possible has a fix for this issue been identified, or even a workaround? The axis work perfectly until any mouse button is pressed then all mouse axis return 0.

Thanks for the help

Here’s the link: Show mouse cursor disables mouse events - Programming & Scripting - Unreal Engine Forums

I am waiting for some info on this too, and I also asked in the Epic Feedbackforum, but haven’t got any answer. I hope someone from the Epic staff will clarify this soon.

Well until then, i have found a workaround. What i ended up doing was creating a function called “ToggleCursor”, in this function I call “set ShowMouseCursor” and feed it a bool. For every mouse button pressed event i send the function a false bool to disable the mouse cursor, then on the release i send the function a true bool to re-enable it. This works for me and lets me continue on with my project until a hotfix is released. If you dont disable the cursor first, the re-enabling of it wont fix this issue, so make sure with this method you always disable it first.

ps. The PlayerControllerRef variable is a PlayerControllerReference I populate in “EventBeginPlay” so I do not have to process that every time I call the function.

Hope this helps.

Yeah, noticed that too. But it was a nice idea! :slight_smile:
Let’s hope for a hotfix!

Well, after some messing around with what I posted. It works as I said it would, but you will have to be careful of your order of operations when placing it. If you are not you wont be able to click any GUI items :wink: that is all I have found so far, but I am almost certain there will be more :wink: Lets hope for a proper hot-fix soon…

Thanks for the workaround – pretty funny side-effect. I can stop play-in-editor if I leave the app and come back, which seems to stop the workaround from working.