Skip to content
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

Mono Unable to Find Input Class #37690

Closed
pihdastudios opened this issue Apr 8, 2020 · 3 comments · Fixed by #38295
Closed

Mono Unable to Find Input Class #37690

pihdastudios opened this issue Apr 8, 2020 · 3 comments · Fixed by #38295

Comments

@pihdastudios
Copy link
Contributor

Godot version:
d89dc57
OS/device including version:
Linux Mint 19.3
Issue description:
Error Input class not found
For example:

Input.SetMouseMode(InputFilter.MouseMode.Captured);

It works in GDScript

Input.set_mouse_mode(InputFilter.MOUSE_MODE_CAPTURED)

Steps to reproduce:
Create a C# script then use the Input class. Like SetMouseMode.

@Calinou
Copy link
Member

Calinou commented Apr 8, 2020

Is this due to the Input -> InputFilter singleton rename?

@pihdastudios
Copy link
Contributor Author

If I use InputFilter it says An object reference is required for the non-static field, method, or property 'InputFilter.SetMouseMode(InputFilter.MouseMode)'

@pihdastudios
Copy link
Contributor Author

Other singletons (OS, Engine) would generate a static class in C#, but InputFilter won't.

Engine::get_singleton()->add_singleton(Engine::Singleton("Input", InputFilter::get_singleton()));
This is probably why using Input in GDScript would work.

I'm working on a fix, lets see how it goes

akien-mga added a commit to akien-mga/godot that referenced this issue Apr 28, 2020
It changed name as part of the DisplayServer and input refactoring
in godotengine#37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes godotengine#37319.
Fixes godotengine#37690.
@akien-mga akien-mga added this to the 4.0 milestone Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants