Project setting for Joypad on unfocused Window#82965
Open
Chtau wants to merge 1 commit intogodotengine:masterfrom
Open
Project setting for Joypad on unfocused Window#82965Chtau wants to merge 1 commit intogodotengine:masterfrom
Chtau wants to merge 1 commit intogodotengine:masterfrom
Conversation
akien-mga
reviewed
Oct 7, 2023
akien-mga
reviewed
Oct 7, 2023
input when the window is not focused.
Sauermann
reviewed
Oct 12, 2023
| #include "core/input/default_controller_mappings.h" | ||
| #include "core/input/input_map.h" | ||
| #include "core/os/os.h" | ||
| #include "servers/display_server.h" |
Contributor
There was a problem hiding this comment.
This was discussed in a PR-review meeting and Input should not depend on display_server.
An alternative approach would be to notify Input from the main loop about application focus changes.
Sauermann
reviewed
Oct 12, 2023
|
|
||
| bool Input::_config_ignore_joypad_on_unfocused_window() { | ||
| if (ignore_joypad_on_unfocused) { | ||
| if (!DisplayServer::get_singleton()->window_is_focused(DisplayServer::MAIN_WINDOW_ID)) { |
Contributor
There was a problem hiding this comment.
This approach doesn't cover the case, that an application can have multiple OS-Windows. Perhaps a better approach would be to take application focus instead of window focus into consideration.
Contributor
|
Adding this option if fine by me—as long as if I disable this option, and enable No Focus, the controller should keep working without the running project having focus. Which is what I prefer. |
Contributor
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Project setting to prevent handling from joypad input when the window is not focused.
Closes #16832