How to completely disable mouse cursor?

Godot Version

v4.7.2.stable.mono.official [ed1daf0bf]

Question

I’m aware about two methods, and both are not fully effective.

You can hide mouse cursor:

Input.MouseMode = Input.MouseModeEnum.Hidden;

This way cursor is not visible, but it still can interact with user interface (like buttons).

There is “stronger” method:

Input.MouseMode = Input.MouseModeEnum.Confined;

This way cursor is not visible and locked at the center of the screen. But it has the same issue - it can still interact with user interface when for example button is at the center of the screen.

Is it possible to fully disable mouse cursor? If not, the only way out that I can see is to use Confined option and design your user interface so there are no interactive elements at the center, which is sometimes easier said than done.

Im sure there is some way to completely deactivate the mouse. But if not, you could set UI to ignore mouse inputs.

UI_node.mouse_filter = Control.MOUSE_FILTER_IGNORE

You could place a global, large invisible control node in front of everything on startup, which will consume any mouse input you might have, and you can control the rest of your interactions via code through keyboard or joystick.

Another way would be to set the mouse filter mode for any control node in the middle of your screen to “mouse_filter_ignore”, and in that case, you should use MOUSE_MODE_CAPTURED instead.

Using an overlay that dynamically turns on/off depending on gamepad state is big brain idea, marking it as solution (unless someone has something even better, but this sounds optimal).