-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a mouse mode that disables mouse input entirely #10170
Comments
You can cover the entire screen with an empty control. This will stop all mouse events. |
I don't think we should make it easier to disable mouse input entirely, as it leads to bad accessibility. Menus ought to be accessible with a mouse whenever possible; don't force players to use a keyboard or gamepad to navigate them. @dalexeev's workaround should already do the trick if you really need this. |
I do agree with the accessibility argument, but some games just aren't designed with mouse controls in mind or don't work well with them and adding support for it can mean doing unnecessary work for something that isn't even needed. There are also other cases where you may want to disable mouse input like in cutscenes.
I didn't know about @dalexeev's solution, I'll update the proposal. |
People are free to design their games in what ever way they want, even if they violate standard good practices and accessibility principles, but if the main purpose of this proposed feature is to enable users to do so I don't think it's a good idea If there are other reasons to add this feature that's another matter IMO, but I don't think we should add a feature specifically for that, i.e. just disabling mouse input instead of disabling all input |
Maybe a better proposal would be to let users disable InputEvents? (Ie.: |
As long as the proposed use is a different one, but I don't how the way it's implemented changes anything if the same underlying reason is the same |
Describe the project you are working on
UI for a 2D metroidvania game.
Describe the problem or limitation you are having in your project
I'd like to disable mouse input for the UI but the only way to do so is by setting the mouse filter to "Ignore" on every element that can be interacted with the mouse, which can take some time or is outright impossible in some cases without doing a hack.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
A way to globally disable mouse input without setting the mouse_mode to captured or hidden would solve the issue.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
A new mouse_mode could work, something like:
Input.mouse_mode = Input.MOUSE_MODE_DISABLED
If this enhancement will not be used often, can it be worked around with a few lines of script?
As mentioned by @dalexeev, you can cover the viewport with a Control node to stop mouse events.
Is there a reason why this should be core and not an add-on in the asset library?
I don't think this can be done with an addon.
The text was updated successfully, but these errors were encountered: