Mouse Click Event not working properly

Hello,

i have a problem with “Mouse Click Event” and tried everything i could find on the internet.

Problem:
When i start my Game (Editor, New Window, Standalone and Packaged) the mouse click event only fires at the first time i single click - then i always have to double click to fire mouse click event.

What i want:
Single Mouse Click Event always be fired. There is no double click defined anywhere in the project.

What i already testet:

  • change input mode to: game only, ui only, game and ui
  • disable/enable mouse for touch
  • disable/enable capture mouse on launch
  • all different settings in “default viewport mouse capture mode”
  • all different settings in “default viewport mouse lock mode”

I am using Unreal Engine 5.4.

Which event? What are you doing, specifically? Enhanced Input, OnClick trace, Left Click in the controller, widget click… there’s a dozen ways to trigger it. So, do tell!

Actually all of them. I have enhanced input with “Left Mouse Button” and “Gamepad Face Button Down”. For testing i added “Left Mouse” Input in player controller or player character with print on “Pressed” execution.

With gamepad it fires all the time but “Left Mouse Button” only fires the first time on single click, then only on double click. In widget it works correctly.

Just noticed:
After first click, when i press “Right Mouse Button” and “Left Mouse Button” it fires.

Is this widget full screen? The first click gets consumed by the UI, but double-click is unhandled and the 2nd click reaches the Player Controller only? Feasible?

Run the Widget Reflector, see what you hit.


After first click, when i press “Right Mouse Button” and “Left Mouse Button” it fires.

That would align with the abovementioned theory, too. The RMB is unhandled, focus is passed to the Player Controller.

I think i found the problem. In the Player Controller there is a “set input game only” event after adding mapping context. I replaced this node with “set input mode game and ui” with no widget in focus, because there is no, except you open the menu.

Now it works but why? On start no widget gets spawned and it was set to “set input game only” and there was this double click problem.

1 Like