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

Prevents stuck if we don't have access to gamepad #1728

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

andrew-git
Copy link
Contributor

Original issue: Failed to execute 'getGamepads' on 'Navigator': Access to the feature "gamepad" is disallowed by permissions policy. #1727

andrew-git and others added 2 commits November 30, 2023 19:36
Original issue: Failed to execute 'getGamepads' on 'Navigator': Access to the feature "gamepad" is disallowed by permissions policy.
@andrew-git
Copy link
Contributor Author

// if something went wrong, treat it the same as when navigator.getGamepads doesn't exist
// we probably don't have permission to use this feature

But we anyway will continue to try get gamepads each frame
https://github.com/openfl/lime/blob/develop/src/lime/_internal/backend/html5/HTML5Application.hx#L362

@joshtynjala Maybe add additional fixes or add flag to disable calls of updateGameDevices() if we don't need gamepads/joysticks in game?

@joshtynjala
Copy link
Member

But we anyway will continue to try get gamepads each frame

This should be fine. It should behave the same as an older browser where navigator.getGamepads doesn't exist: updateGameDevices() will see null and return early.

@joshtynjala joshtynjala merged commit c40ec31 into openfl:develop Dec 1, 2023
26 checks passed
@andrew-git andrew-git deleted the patch-1 branch December 2, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants