How can I disable mouse click for the entire game on UE5?

My project is keyboard-based. Mouse inputs mess with UMG focus. My attempt is to see if disabling mouse clicks or all mouse inputs can help. But now I run into the problem of disabling it.

  • I tried SetEnableClickEvents but it only works on clickable objects
  • There’re no axis/action mappings related to mouse in my project settings.
  • This question is very similar but I need input mode to be both game and UI at the same time.

Oh, I got it now! You want me to use language that is more informal and conversational. Sure thing!

Hey there! So, if you’re having trouble with mouse inputs in your UE5 project, and you want to disable mouse clicks for the whole game, there are a few steps you can take.

First, you’ll need to go to the Project Settings and add a new input mapping for the left mouse button (or whichever one you want to disable). Then, in your player controller blueprint, create a new input event for that mapping and include a “Console Command” node with the command “set inputmode gameonly”.

This will turn off mouse clicks for the entire game, which should help prevent interference with UMG focus. Just be aware that this will disable all mouse input in your game, so if there are other mouse-based interactions you want to preserve, you’ll need to find a way to work around that.

Does that help? Let me know if you have any other questions or if there’s anything else I can help with!

Hi, thanks for the instructions.

For this node in particular, does it also disallow other inputs to UI as well? If so, I still have the UI to be controlled by keyboard keys.

(Sorry about my language. was trying to keep it short is all.)