[4.12 possible bug] InputAction for mouse only fires sometimes with ShowMouseCursor & InputModeGameOnly set on player controller

In a new project of mine I’m creating a 2D game and want to show the mouse while the inputmode is set to gameonly so my hud widgets wont be clicked.

I noticed however that only some mouse clicks gives a response. I tracked the problem down to being caused by the combo of ShowMouseCursor=true and SetInputModeGameOnly.

When I check this out in an old project [UE 4.8.3] all mouse clicks gives a response.

After some more testing I noticed that if you click continually but with large intervals there will be no responses from any clicks. If you do it fast then it seems every second click has a response. It is like something somewhere gets focus for a moment allowing the next click to work.

Testing it is really simple.

  1. Simply create a new blank project and add a custom PlayerController and GameMode(so we can add the PlayerController) and set them as the default in ‘Project Settings’ → ‘Maps & Modes’.
  2. Goto the ‘Project Settings’ → ‘Input’ and create a new Action Mapping set to ‘Left Mouse Button’(have not tried if the other options gives the same behavior).
  3. Goto custom PlayerController and add the Action Mapping event and drag a node of to a Print String or something similar that can easily give us feedback.
  4. Add a ShowMouseCursor node set to true from the PlayerController BeginPlay event and also add a SetInputModeGameOnly to the BeginPlay event (the order is irrelevant).
  5. Compile all hit ‘Play’ and start clicking

In case this is intended behavior I wonder how/if I can get the old behavior back.

Hello Insanez,

I was unable to reproduce this issue on our end. The left mouse button appears to fire off correctly with every click under the suggested settings. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean blank project?
  2. Does this only happen when using a 2D template?
  3. Could you provide any small steps that may have been missed in your original reproduction steps?
  4. Could you provide screen shots of any settings/blueprints that may be involved?

Hello Insanez,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks