Skip to content

Comments

fix(Focus): re-focus ui if focus is lost but a direction is pressed#483

Merged
ShadowApex merged 1 commit intomainfrom
shadowapex/focus-on-unfocused
Sep 22, 2025
Merged

fix(Focus): re-focus ui if focus is lost but a direction is pressed#483
ShadowApex merged 1 commit intomainfrom
shadowapex/focus-on-unfocused

Conversation

@ShadowApex
Copy link
Collaborator

In some cases, a user may find themselves in a position where no UI element is currently focused and will be unable to use the joystick or d-pad to regain control. This change updates the InputManager to find a focusable node and focus it if a direction is pressed and nothing is focused, ensuring that the user will always be able to use gamepad controls.

Because the logic already exists for recursively finding a focusable node in FocusGroup, this change updates the find_focusable method in that class to be a public static method so it can be used elsewhere.

@ShadowApex ShadowApex marked this pull request as ready for review August 15, 2025 06:55
@ShadowApex ShadowApex requested a review from pastaq August 15, 2025 06:55
Copy link
Collaborator

@pastaq pastaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also ensure the overlay mode input manager has parity?

@ShadowApex ShadowApex force-pushed the shadowapex/focus-on-unfocused branch from fa11a3a to 1766250 Compare August 16, 2025 03:59
@ShadowApex ShadowApex requested a review from pastaq August 16, 2025 03:59
Copy link
Collaborator

@pastaq pastaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. No time to test, send it if you think it works everywhere

@ShadowApex ShadowApex merged commit f6d5491 into main Sep 22, 2025
2 checks passed
@ShadowApex ShadowApex deleted the shadowapex/focus-on-unfocused branch September 22, 2025 01:07
@github-actions
Copy link
Contributor

🎉 This PR is included in version 0.42.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants