Skip to content

Commit 6971c4b

Browse files
committed
Fixed documentation of bindings with modifiers and UI Toolkit tooltips 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).
1 parent b0478f0 commit 6971c4b

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ however, it has to be formatted properly to pass verification tests.
2222
- Fixed missing documentation for source generated Input Action Assets. This is now generated as part of the source code generation step when "Generate C# Class" is checked in the importer inspector settings.
2323
- Fixed pasting into an empty map list raising an exception. [ISXB-1150](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1150)
2424
- Fixed pasting bindings into empty Input Action asset. [ISXB-1180](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1180)
25+
- Fixed tooltip support in the UI Toolkit version of the Input Actions Asset editor.
26+
- Fixed documentation to clarify bindings with modifiers `overrideModifiersNeedToBePressedFirst` configuration [ISXB-806](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-806).
2527

2628
### Changed
2729
- Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/ButtonWithOneModifier.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,16 @@ public class ButtonWithOneModifier : InputBindingComposite<float>
7979
/// still trigger. Default is false.
8080
/// </summary>
8181
/// <remarks>
82-
/// By default, <see cref="modifier"/> is required to be in pressed state before or at the same time that <see cref="button"/>
82+
/// By default, if the setting <see cref="InputSettings.shortcutKeysConsumeInput"/> is enabled,
83+
/// <see cref="modifier"/> is required to be in pressed state before or at the same time that <see cref="button"/>
8384
/// goes into pressed state for the composite as a whole to trigger. This means that binding to, for example, <c>Shift+B</c>,
8485
/// the <c>shift</c> key has to be pressed before pressing the <c>B</c> key. This is the behavior usually expected with
8586
/// keyboard shortcuts.
8687
///
8788
/// This parameter can be used to bypass this behavior and allow any timing between <see cref="modifier"/> and <see cref="button"/>.
8889
/// The only requirement is for them both to concurrently be in pressed state.
8990
/// </remarks>
91+
[Tooltip("If checked, it will bypass the InputSettings.shortcutKeysConsumeInput setting and the modifier can be pressed after and the composite will still trigger")]
9092
public bool overrideModifiersNeedToBePressedFirst;
9193

9294
/// <summary>

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/ButtonWithTwoModifiers.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ public class ButtonWithTwoModifiers : InputBindingComposite<float>
9494
/// and the composite will still trigger. Default is false.
9595
/// </summary>
9696
/// <remarks>
97-
/// By default, <see cref="modifier1"/> and <see cref="modifier2"/> are required to be in pressed state before or at the same
97+
/// By default, if the setting <see cref="InputSettings.shortcutKeysConsumeInput"/> is enabled,
98+
/// <see cref="modifier1"/> and <see cref="modifier2"/> are required to be in pressed state before or at the same
9899
/// time that <see cref="button"/> goes into pressed state for the composite as a whole to trigger. This means that binding to,
99100
/// 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.
100101
/// This is the behavior usually expected with keyboard shortcuts.
101102
///
102103
/// This parameter can be used to bypass this behavior and allow any timing between <see cref="modifier1"/>, <see cref="modifier2"/>,
103104
/// and <see cref="button"/>. The only requirement is for all of them to concurrently be in pressed state.
104105
/// </remarks>
106+
[Tooltip("If checked, it will bypass the InputSettings.shortcutKeysConsumeInput setting and the modifiers can be pressed after and the composite will still trigger")]
105107
public bool overrideModifiersNeedToBePressedFirst;
106108

107109
/// <summary>

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/OneModifierComposite.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public class OneModifierComposite : InputBindingComposite
8888
/// Default value is <c>false</c>.
8989
/// </summary>
9090
/// <remarks>
91-
/// By default, if <see cref="binding"/> is bound to only <see cref="Controls.ButtonControl"/>s, then the composite requires
91+
/// By default, if the setting <see cref="InputSettings.shortcutKeysConsumeInput"/> is enabled,
92+
/// if <see cref="binding"/> is bound to only <see cref="Controls.ButtonControl"/>s, then the composite requires
9293
/// <see cref="modifier"/> to be pressed <em>before</em> pressing <see cref="binding"/>. This means that binding to, for example,
9394
/// <c>Ctrl+B</c>, the <c>ctrl</c> keys have to be pressed before pressing the <c>B</c> key. This is the behavior usually expected
9495
/// with keyboard shortcuts.
@@ -101,6 +102,7 @@ public class OneModifierComposite : InputBindingComposite
101102
/// is bound to, any press sequence is acceptable. For the example binding to <c>Ctrl+B</c>, it would mean that pressing <c>B</c> and
102103
/// only then pressing <c>Ctrl</c> will still trigger the binding.
103104
/// </remarks>
105+
[Tooltip("If checked, it will bypass the InputSettings.shortcutKeysConsumeInput setting and the modifier can be pressed after and the composite will still trigger")]
104106
public bool overrideModifiersNeedToBePressedFirst;
105107

106108
private int m_ValueSizeInBytes;

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/TwoModifiersComposite.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ public class TwoModifiersComposite : InputBindingComposite
9090
/// Default value is <c>false</c>.
9191
/// </summary>
9292
/// <remarks>
93-
/// By default, if <see cref="binding"/> is bound to only <see cref="Controls.ButtonControl"/>s, then the composite requires
93+
/// By default, if the setting <see cref="InputSettings.shortcutKeysConsumeInput"/> is enabled,
94+
/// if <see cref="binding"/> is bound to only <see cref="Controls.ButtonControl"/>s, then the composite requires
9495
/// both <see cref="modifier1"/> and <see cref="modifier2"/> to be pressed <em>before</em> pressing <see cref="binding"/>.
9596
/// This means that binding to, for example, <c>Ctrl+Shift+B</c>, the <c>ctrl</c> and <c>shift</c> keys have to be pressed
9697
/// before pressing the <c>B</c> key. This is the behavior usually expected with keyboard shortcuts.
@@ -103,6 +104,7 @@ public class TwoModifiersComposite : InputBindingComposite
103104
/// is bound to, any press sequence is acceptable. For the example binding to <c>Ctrl+Shift+B</c>, it would mean that pressing
104105
/// <c>B</c> and only then pressing <c>Ctrl</c> and <c>Shift</c> will still trigger the binding.
105106
/// </remarks>
107+
[Tooltip("If checked, it will bypass the InputSettings.shortcutKeysConsumeInput setting and the modifiers can be pressed after and the composite will still trigger")]
106108
public bool overrideModifiersNeedToBePressedFirst;
107109

108110
/// <summary>

Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/ParameterListView.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,46 +280,47 @@ void OnEditEnd()
280280
{
281281
var intValue = parameter.value.value.ToInt32();
282282
var field = new DropdownField(label.text, parameter.enumNames.Select(x => x.text).ToList(), intValue);
283+
field.tooltip = label.tooltip;
283284
field.RegisterValueChangedCallback(evt => OnValueChanged(ref parameter, field.index, closedIndex));
284285
field.RegisterCallback<BlurEvent>(_ => OnEditEnd());
285286
root.Add(field);
286287
}
287288
else if (parameter.value.type == TypeCode.Int64 || parameter.value.type == TypeCode.UInt64)
288289
{
289290
var longValue = parameter.value.value.ToInt64();
290-
var field = new LongField(label.text) { value = longValue };
291+
var field = new LongField(label.text) { value = longValue, tooltip = label.tooltip };
291292
field.RegisterValueChangedCallback(evt => OnValueChanged(ref parameter, evt.newValue, closedIndex));
292293
field.RegisterCallback<BlurEvent>(_ => OnEditEnd());
293294
root.Add(field);
294295
}
295296
else if (parameter.value.type.IsInt())
296297
{
297298
var intValue = parameter.value.value.ToInt32();
298-
var field = new IntegerField(label.text) { value = intValue };
299+
var field = new IntegerField(label.text) { value = intValue, tooltip = label.tooltip };
299300
field.RegisterValueChangedCallback(evt => OnValueChanged(ref parameter, evt.newValue, closedIndex));
300301
field.RegisterCallback<BlurEvent>(_ => OnEditEnd());
301302
root.Add(field);
302303
}
303304
else if (parameter.value.type == TypeCode.Single)
304305
{
305306
var floatValue = parameter.value.value.ToSingle();
306-
var field = new FloatField(label.text) { value = floatValue };
307+
var field = new FloatField(label.text) { value = floatValue, tooltip = label.tooltip };
307308
field.RegisterValueChangedCallback(evt => OnValueChanged(ref parameter, evt.newValue, closedIndex));
308309
field.RegisterCallback<BlurEvent>(_ => OnEditEnd());
309310
root.Add(field);
310311
}
311312
else if (parameter.value.type == TypeCode.Double)
312313
{
313314
var floatValue = parameter.value.value.ToDouble();
314-
var field = new DoubleField(label.text) { value = floatValue };
315+
var field = new DoubleField(label.text) { value = floatValue, tooltip = label.tooltip };
315316
field.RegisterValueChangedCallback(evt => OnValueChanged(ref parameter, evt.newValue, closedIndex));
316317
field.RegisterCallback<BlurEvent>(_ => OnEditEnd());
317318
root.Add(field);
318319
}
319320
else if (parameter.value.type == TypeCode.Boolean)
320321
{
321322
var boolValue = parameter.value.value.ToBoolean();
322-
var field = new Toggle(label.text) { value = boolValue };
323+
var field = new Toggle(label.text) { value = boolValue, tooltip = label.tooltip };
323324
field.RegisterValueChangedCallback(evt => OnValueChanged(ref parameter, evt.newValue, closedIndex));
324325
field.RegisterValueChangedCallback(_ => OnEditEnd());
325326
root.Add(field);

0 commit comments

Comments
 (0)