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

Game controller issue with multiple Godot game instances. #33656

Closed
capnm opened this issue Nov 16, 2019 · 4 comments
Closed

Game controller issue with multiple Godot game instances. #33656

capnm opened this issue Nov 16, 2019 · 4 comments
Labels

Comments

@capnm
Copy link
Contributor

capnm commented Nov 16, 2019

Godot version:
98caeb6
Date: Fri Nov 15 13:31:32 2019 +0100
OS/device including version:
Linux, Ubuntu 18.04.3 LTS
Issue description:
While preparing a multiplayer demo (by the way, Godot's hi-level network works much better than bevore), one kid brought an original PS4 controller and I noticed that Godotengine is receiving the controller (USB) events in parallel in all started Game instances, regardless of whether the window is selected or not. I expected it to behave like other input devices.

In the practice, this is only a problem by multiplayer development on a single computer.
I also could not find a GDScript function that indicates whether the application window is selected or not.

@mischiefaaron
Copy link

mischiefaaron commented Nov 17, 2019

It is not only a problem for online multiplayer development when tested locally as you say.
Even with one instance this is an issue for me as it takes gamepad input when not in focus, something that can be a problem from the user end if the player decides to do something else but accidentally presses stuff on their controller in the mean time.

I actually think it should be an option, but inactive when unfocused by default as most would like. Reason being is that I would like to take advantage of this for a streaming application that displays my gamepad inputs while playing a different game. Kind of like this: https://gamepadviewer.com/

@Calinou
Copy link
Member

Calinou commented Nov 17, 2019

Duplicate of #16832.

@capnm
Copy link
Contributor Author

capnm commented Nov 18, 2019

Thanks! I missed the constants in
https://docs.godotengine.org/en/latest/classes/class_mainloop.html :-)
With the notification event, I could track the focus state myself …

@steveweenie
Copy link

This is still a problem... i'm trying to add networked splitscreen into my game and its impossible to tell if inputs are split from each other from multiple instances. What even is the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants