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: Fixed documentation of bindings with modifiers and UI Toolkit tooltips in the asset editor (ISBX-806) #2048

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

bmalrat
Copy link
Collaborator

@bmalrat bmalrat commented Nov 13, 2024

Description

The documentation of overrideModifiersNeedToBePressedFirst was not very clear and lead to miss configuration. https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-806

I added a Tooltip in the UI and fixed the Tooltips support for UI Toolkit version of the Input Actions Asset editor.
Please note that there is currently a limitation within UI Toolkit that doesn't display tooltip if the label of the field is truncated.

Testing status & QA

Tested on windows 6000.0.26f1
Screenshot 2024-11-13 115341

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:
  • Halo Effect:

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • [X ] 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.

…s in the asset editor

- Fixed tooltip support in the UI Toolkit version of the Input Actions Asset editor.
- Fixed documentation to clarify bindings with modifiers `overrideModifiersNeedToBePressedFirst` configuration [ISXB-806](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-806).
/// goes into pressed state for the composite as a whole to trigger. This means that binding to, for example, <c>Shift+B</c>,
/// the <c>shift</c> key has to be pressed before pressing the <c>B</c> key. This is the behavior usually expected with
/// keyboard shortcuts.
///
/// This parameter can be used to bypass this behavior and allow any timing between <see cref="modifier"/> and <see cref="button"/>.
/// The only requirement is for them both to concurrently be in pressed state.
/// </remarks>
[Tooltip("If checked, it will bypass the InputSettings.shortcutKeysConsumeInput setting and the modifier can be pressed after and the composite will still trigger")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that correct? It sounds like the reverse logic to my reading of the variable.

I think this is the state:

// Ordering important
overrideModifiersNeedToBePressedFirst = true

// Ordering not important
overrideModifiersNeedToBePressedFirst = false

If that's not the case then the variable and text next to the checkbox would also need changing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Current state is :
if InputSettings.shortcutKeysConsumeInput is false (the default)
// Ordering not important in all case

if InputSettings.shortcutKeysConsumeInput is true
// Ordering important
overrideModifiersNeedToBePressedFirst = false

// Ordering not important
overrideModifiersNeedToBePressedFirst = true

the name overrideModifiersNeedToBePressedFirst override the setting and doesn't really describe the composite behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wow that's confusing. Making it clearer with the tooltip is helpful but I'd prefer if we tidied this up further to make it much more intuitive.

@Pauliusd01
Copy link
Collaborator

Pauliusd01 commented Nov 14, 2024

I see the tooltips just fine on one and two modifiers but I'm not even sure I understand the tooltip correctly it seems confusing. Maybe adding Ben is a good idea to proof read?

My suggestion would be to change it to:
"If enabled, this will override the Input Consumption setting, allowing the modifier key to be pressed while still triggering the composite action." (Maybe even mentioning where to find the setting in parentheses is a good idea)

I renamed the setting from a script one to the settings one, that I assume will be more familiar to people and rephrased it a bit.

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.

Just updating status that I checked it, I can approve if my suggestion isn't good just let me know

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