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

FIX: ISXB-808 scroll wheel event system different than ui builder #1959

Merged

Conversation

benoitalain
Copy link
Collaborator

@benoitalain benoitalain commented Jul 3, 2024

Description

Fixes ISXB-808. Based on recently landed trunk PR.

Details of what was changed and the thought process can be found in these Google Documents:

Changes made

This PR makes scroll delta values reaching UI Toolkit as uniform as possible between different platforms and between editor or runtime. The standard used is that of the Windows Editor, i.e. the same text in an TextField should scroll by the same amount in an EditorWindow than in a runtime panel, with or without uGUI interoperability.

Since legacy input is still supported in Unity 6, we make the InputSystem match the scaling of the legacy input by default. However, we also introduce a new scrollDeltaPerTick property API to allow users to fall back on the scroll factor that we had in InputSystem package version <= 1.4, by setting it to a value of 6.

Testing

Manually tested the changes. Modified existing unit test and added one for the newly introduced API.

Risk

This PR yet again changes the scroll factor for existing user projects without any notification about it. Fortunately, they can very easily tweak it back to whatever they had, but this may still come as a surprise to them. On the other hand, the new setup is much much better for new projects, and for existing projects it's probably better too, allowing users to remove their workaround for the previously bad scroll factors.

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.

benoitalain and others added 22 commits June 5, 2024 11:35
…08-scrollwheeleventsystemdifferentthanuibuilder

# Conflicts:
#	Packages/com.unity.inputsystem/CHANGELOG.md
#	Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs
…om:Unity-Technologies/InputSystem into isxb-704-scrollwheelwindowsrawvaluesupport

# Conflicts:
#	Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs
…08-scrollwheeleventsystemdifferentthanuibuilder

# Conflicts:
#	Packages/com.unity.inputsystem/CHANGELOG.md
#	Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs
…08-scrollwheeleventsystemdifferentthanuibuilder
…08-scrollwheeleventsystemdifferentthanuibuilder
@unity-cla-assistant
Copy link

unity-cla-assistant commented Jul 3, 2024

CLA assistant check
All committers have signed the CLA.

…nto isxb-808-scrollwheeleventsystemdifferentthanuibuilder

# Conflicts:
#	Assets/Tests/InputSystem/Plugins/UITests.cs
#	Assets/Tests/InputSystem/Unity.InputSystem.Tests.asmdef
#	Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs
#	Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef
…nto isxb-808-scrollwheeleventsystemdifferentthanuibuilder

# Conflicts:
#	Packages/com.unity.inputsystem/CHANGELOG.md
@benoitalain benoitalain changed the title Isxb 808 scrollwheeleventsystemdifferentthanuibuilder FIX: ISXB-808 scroll wheel event system different than ui builder Jul 16, 2024
@@ -116,6 +116,24 @@ internal GameObject localMultiPlayerRoot
set => m_LocalMultiPlayerRoot = value;
}

/// <summary>
/// A multiplier value that allows you adjust the scroll wheel speed sent to uGUI (Unity UI) components.
Copy link
Collaborator Author

@benoitalain benoitalain Jul 17, 2024

Choose a reason for hiding this comment

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

that allows you adjust

that allows you to adjust

Copy link
Collaborator

@duckets duckets left a comment

Choose a reason for hiding this comment

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

Approved with docs amendments

@benoitalain benoitalain force-pushed the isxb-808-scrollwheeleventsystemdifferentthanuibuilder branch from 68a9289 to 9d54366 Compare July 17, 2024 19:36
@benoitalain benoitalain merged commit 230cfd6 into develop Jul 17, 2024
77 of 79 checks passed
@benoitalain benoitalain deleted the isxb-808-scrollwheeleventsystemdifferentthanuibuilder branch July 17, 2024 20:57
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.

4 participants