Bug: Mouse Clicks not responding after set Input UI, then to Game

In 4.10 I didn’t have any missed mouse clicks. In 4.11 I did, I would have to click 10 or 11 times to get it to register once.

In my main menu map, as the UMG is loaded I was setting the controller to InputMode UI only. When the map was launched I set the InputMode to Game Only.

The result was, keyboard would work, but mouse clicks not registering.

Removing both nodes fixed the problem, but I would have prefered there to be no game input when there was a full screen UMG widget.

This is a bug. I already have a fix, by not using the nodes. It might cause someone else a headache if they run into it so I’m reporting it.

Hi ,

  • Does this occur in a clean, blank project with no additional content or is it limited to one project?
  • What steps can I take to reproduce this error on my end?
  • Do you have any other assets or blueprints that may be consuming the mouse input?

I only tried this in the specific project.

To reproduce:
In Input file add a MouseClicked event.
In controller, put a print statement off the event. Test that each time you click, it prints.
open a UMG Widget and set InputMode to UI Only.
Close the Widget, (from the widget) and set the InputMode to Game Only.

Now test clicking the mouse button. Only about 1 in 10 will respond and print.

I don’t believe anything else is consuming them. Because, if I unhook all the SetInput nodes, it works fine.

This got stranger. I found some notes from on the forums.

Apparently, calling Set Input Mode UI, or Game and UI or Game no longer works except if you call it from inside the PlayerController. Even setting the reference to the PlayerController does not work correctly if from the UMG.

Setting an Event on the PlayerController, and have the UMG call the Event and pass itself to the PlayerController at the end of consrtuct seemed to fix the problem of having focus, and can again get Gamepad events in the UMG.

Edit: The events are not in the OnKeyDown, they are getting handled under the hood somewhere, with DPad changing highlighing on the buttons. It has now hyjacked handling Controller input.

The Controller bottom face button now simulates a mouse click.

But, the Hover, UnHover shows a dotted line around the bounding box of the Buttons instead of switching to the images to Hovered and back to normal.

4.11 really messed up the UMG with focus. Especially since it didn’t support Gamepad and the mouse enter and leave functions were private, many people will have their own solution to Simulate Button Hovers and Clicks so the GamePad can navigate.

Hi ,

There are several known issues with set input UI. The one I think is applying in this case is UE-14476. Switching set input to either UI/Game/Game and UI consumes all controller input, which could cause errors such as the one you are seeing. I am going to update this bug report to reflect that additional developers are experiencing it.


I thought I had it sorted out, by setting it through an event on the PlayerController as I saw in 's post but, I’m left with one unresolved issue.

My game is either in GameController mode, or Keyboard and mouse, which is set on game launching as a variable in the GameState class.

If I don’t use those input sets, I can’t use the UMG menu’s with the Controller, but if I do, the mouse clicks are messed up.

Also, the way UMG and the Controller is working has changed, and not for the good. In 4.10 I processed the OnKeyDown event on the UMG and then tested the key for type and called functions explicitly which navigated my buttons. I extended the UMG Button to call the hover event to do this.

Now, the OnKeyDown is not getting called for the D-Pad, the input is being captured under the hood in Slate somewhere. There is now some automatic button navigation with the D-Pad, but it is not calling the hover events correctly, it creates a dotted line box around the button’s image. The bottom face button now simulates a mouse click on the button as well. I didn’t see this stuff in the upgrade notes, and it is not working correctly. Because it is hijacking the input at a low level it’s difficult to work with from a launcher version of the engine.

This is another known issue and is in our system as UE-28825.

It’s been 3 weeks, has this bug been addressed? In 4.12 it is still broken, only about 1 out of 10 mouse clicks is registered. Shooting works good with controller but sucks with mouse, basically unplayable as a pc game with mouse and keyboard.

HI ,

This error is still under assessment by the development staff. Unfortunately I do not have a timeframe of when it will be addressed.

I just had the same issue in 4.12 and I seem to have fixed it by not hooking anything up to the target pin on the Set Input Mode Game Only node inside the player controller BP

I am also experiencing this bug in 4.13. I haven’t checked 4.13.1 yet, but there is nothing in the patchnotes that seems to fix that problem.
Google tells me that UE-14476, but it seems to me that this is not the bug OP was talking about. After switching to InputMode GameOnly, my game takes mouse down events only when I double click (resulting in the behavior described above if you are not aware of the situation and just randomly click in your window).

I have a main menu, where I set Input Mode UI only, and on PostLogin in the actual game I change the InputMode to GameOnly (I am copying MP behavior from the Shootout example).
If i use tsaroths suggestion, the nodes do not seem to do anything at all.

I also tried a custom node with C++ Code [PlayerController]->SetInputMode(FInputModeGameOnly());, but that didn’t work either.

Are there workarounds? Besides not using these nodes at all?

Hi Harth Tuwist,

UE-14476 was closed as ‘Cannot Reproduce’. Do you have any specific steps I can take to recreate this on my end?

I reproduced this on a new project:

  1. Take the top down example
  2. Add a keyboard bind and let it run the code “Get player controller (0) → Set Input Mode Game Only” in the level Blueprint (but anywhere else it is the same problem)
  3. Build an actor that changes the Material when the “OnClick” event is run

When you run it:
-Just clicking on the actor: A single click changes the material
-Clicking on the actor after Input Mode Game Only was set: you need to double click on the actor to make it change Material (the first time after the input it actually works with a casual click, but after that you need a double click).

Edit: Sorry for formatting

Hi Harth Tuwist,

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here. You can track the report’s status as the issue is reviewed by our development staff.

I was experiencing the same problem. I start my game and everything is fine. I open the options menu UMG and it works fine. I click on the return to the game and my mouse will click about once every 20 attempts and always the 1st click works. Thankfully the removing the target on the set ‘input mode game only’ has done the trick. Thanks TSAROTH :slight_smile:

Thanks this worked for me :slight_smile:

In the same example I only need to the node “Input Mode Game Only” with a “Get player controller” and I have this bug. This kill my actually project, but I havent any "Input Mode Game Only"nodes in my Project.
I am not shure whats the problem, but need a resolve

I found a solution. Disable the “Show Mouse Cursor” in the Controller and everthing works perfect. But if you have no other cursor and need someone you must create your own.

This Worked for me for now. My Game I will need to show cursor Hoping it gets fixed soon.

My Game is using 4.15 and this was a bug that I thought was an issue with my logic as my project relies heavily on mouse inputs and mouse click Combinations. I Ripped apart most of my logic to figure out where I messed up and after I stopped second guessing myself I decided to do a search and found this post. That will teach me lol. Once I realized it was a bug with UE4 thanks to this post I set to find a workaround. I think it was already mentioned here but I found out that just removing the Input mode nodes on my project the bug stopped and the lack of the nodes had no effect on my projects performance at all.

Attached A Screenshot for those who need a visual for this solution.