MouseX BindAxis returning 0 unless mouse button depressed

Hey , I’m not one of the original posters, but seeing this problem in both release branch and promoted branch. Interesting pieces of info from testing.

  1. (No longer true, see bottom of post) I cannot seem to replicate the issue in the FPS sample project, though I have not tested adding new axis.

  2. Whatever the issue is, it’s propogated all the way from UPlayerInput::GetKeyValue(FKey InKey) forward. (KeyState->Value.X is always 0 unless a mouse button is down.)

My assumption here is that there’s some sort of additional config value that is missing somewhere from my project that is present in the FPS sample, but for the life of me I cannot find anything relevant, even after digging in a diff between the projects DefaultInput.ini files.

Continuing to dig for now. I’ve also been having issues getting this comment to post, so apologies if I come back later and find it’s posted 7x or something.

Edit: Further Digging - It seems like in FSceneViewport::ProcessAccumulatedPointerInput the NumMouseSamplesX/Y is always 0 as long as no buttons are being pressed. Further digging shows that in FSceneViewport::OnMouseMove, the calculated bool bViewportHasCapture is always false unless a mouse key is held down, resulting in the mouse not being sampled. Unfortunately the intricacies of how that boolean is calculated seem a little beyond a few minutes of digging, and I need to get groceries. More digging later.

Edit Round 2 : As per the below post:

This problem can be replicated in the base FPS Test application by simply pausing the game state and enabling the mouse cursor on the PlayerController actor.

1 Like