-
Notifications
You must be signed in to change notification settings - Fork 328
FIX: Fixed documentation of bindings with modifiers and UI Toolkit tooltips in the asset editor (ISBX-806) #2048
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
Conversation
…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).
| /// 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")] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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: 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. |
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I approve this change.
Couple of minor typos to fix.
Would be useful to update the description image
| // Legacy. We need to reference the obsolete member here so temporarily | ||
| // turn off the warning. | ||
| #pragma warning disable CS0618 | ||
| if (overrideModifiersNeedToBePressedFirst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we are preserving old behaviour which is great to see.
| #pragma warning restore CS0618 | ||
| modifiersOrder = ModifiersOrder.Unordered; | ||
| else | ||
| modifiersOrder = InputSystem.settings.shortcutKeysConsumeInput ? ModifiersOrder.Ordered : ModifiersOrder.Unordered; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this changing the stored value from default to a specific value?
I'm thinking this should be on reading the value rather than changing what's stored.
That said this code was making a change directly before so its not altering behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't changed the stored value. The class is not serialized within the classic unity serialization.
It's serialized in the inputaction asset in json.
like
{
"name": "Two Modifiers",
"id": "9796175a-7495-4ded-9b01-e17eafba2eaf",
"path": "TwoModifiers(overrideModifiersNeedToBePressedFirst=true,modifiersOrder=1)",
"interactions": "",
"processors": "",
"groups": "",
"action": "New action",
"isComposite": true,
"isPartOfComposite": false
},
The value is only changed a runtime when the binding is setup
Packages/com.unity.inputsystem/InputSystem/Actions/Composites/TwoModifiersComposite.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Actions/Composites/ButtonWithOneModifier.cs
Outdated
Show resolved
Hide resolved
…s-doc-and-tooltips
|
By the way, I see Publish to Internal Registry job is failing, probably means you will need to up the next version? @ekcoh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, since we any way make modifications in the area we might as well also be clear regarding any expected or rather non-expected ordering of modifiers. E.g. for Ctrl+Shift+B, is Ctrl expected to be pressed before Shift in any scenario or is the new setting applying to Modifier-group vs Trigger only. Also consider removing the obsolete member for any major revision forward ports.
| /// By default, if the setting <see cref="InputSettings.shortcutKeysConsumeInput"/> is enabled, | ||
| /// <see cref="modifier1"/> and <see cref="modifier2"/> are required to be in pressed state before or at the same | ||
| /// time that <see cref="button"/> goes into pressed state for the composite as a whole to trigger. This means that binding to, | ||
| /// for example, <c>Ctrl+Shift+B</c>, the <c>ctrl</c> <c>shift</c> keys have to be pressed before pressing the <c>B</c> key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great you are clarifying this, but still unclear whether ctrl and shift is ordered or not. I suggest either adding this information, e.g. if its a sequence or a set of pressed buttons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctrl and shift doesn't need to be in order. I will precise it.
Packages/com.unity.inputsystem/InputSystem/Actions/Composites/OneModifierComposite.cs
Show resolved
Hide resolved
…omposites-with-modifiers-doc-and-tooltips # Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
Yes, it needs to be a minor version bump due to introducing API |
…omposites-with-modifiers-doc-and-tooltips # Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
Description
The documentation of
overrideModifiersNeedToBePressedFirstwas not very clear and lead to miss configuration. https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-806I 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

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.
Comments to reviewers
Please describe any additional information such as what to focus on, or historical info for the reviewers.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.After merge: