Skip to content

FIX: Gamepad stick inputs are not recognized in WebGL Player (ISXB-1090) #2165

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

Merged
merged 4 commits into from
Apr 16, 2025

Conversation

jfreire-unity
Copy link
Collaborator

@jfreire-unity jfreire-unity commented Apr 9, 2025

Description

Fixes issue reported here due to WebGLGamepad's not having the stick up/down control values.

To fix the issue, the clamping range for those controls was changed and the test now asserts for the correct values.

Moreover, the UI test was improved so that the actions set-up are DefaultInputActions that come by default with UIInputModule. Previously, the test didn't account for a composite binding that are used for left/right/up/down controls.
These changes to the UITest would have failed with the fix (I confirmed it).

Testing status & QA

Tested in the WebGL player and it fixes the reported issue.

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity: 0
  • Halo Effect: 1

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@jfreire-unity jfreire-unity force-pushed the isxb-1090-fix-webgl-gamepad-up-down-sticks branch from 8a5ce74 to 7747a0a Compare April 11, 2025 12:43
@jfreire-unity jfreire-unity requested a review from Copilot April 11, 2025 13:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comment on lines -2882 to -2884
var moveAction = map.AddAction("move", type: InputActionType.PassThrough, binding: "<Gamepad>/*stick");
var submitAction = map.AddAction("submit", type: InputActionType.PassThrough, binding: "<Gamepad>/buttonSouth");
var cancelAction = map.AddAction("cancel", type: InputActionType.PassThrough, binding: "<Gamepad>/buttonEast");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't reflect ou UI default actions setup. That's why I used the ones we use by default.

@ritamerkl
Copy link
Collaborator

Good to have the testcase for WEBGL now, thanks for adding

@jfreire-unity jfreire-unity requested review from Pauliusd01 and removed request for Pauliusd01 April 14, 2025 13:43
@Pauliusd01
Copy link
Collaborator

Did not forget about this one, will try to check today/tomorrow

Copy link
Collaborator

@Pauliusd01 Pauliusd01 left a comment

Choose a reason for hiding this comment

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

Things checked: different testing scenes on firefox and chrome builds with xbox, ps4 and ps5 controllers both wired and on bluetooth. Everything worked as expected on chrome while on firefox the ps5 controller throws this error below on both wired and bluetooth. And only right side buttons work while analog sticks do not. I don't know if this is for us to fix or something on firefox people so let me know if I should change this to approve instead. (The button behaviour before these changes on firefox is the same except there's no error there)

image

@Pauliusd01 Pauliusd01 self-requested a review April 16, 2025 09:55
Copy link
Collaborator

@Pauliusd01 Pauliusd01 left a comment

Choose a reason for hiding this comment

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

Discussed the firefox issue with Joao and these changes shouldn't have caused it. Will file it separately

@jfreire-unity jfreire-unity force-pushed the isxb-1090-fix-webgl-gamepad-up-down-sticks branch from 93445f2 to 4bd2854 Compare April 16, 2025 10:03
@jfreire-unity jfreire-unity merged commit 8b13d7d into develop Apr 16, 2025
110 checks passed
@jfreire-unity jfreire-unity deleted the isxb-1090-fix-webgl-gamepad-up-down-sticks branch April 16, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants