Skip to content

Commit b7d5a5d

Browse files
Fix broken test due to shortcutKeysConsumeInput setting.
1 parent eddb699 commit b7d5a5d

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

Assets/Tests/InputSystem/CoreTests_Actions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ public void Actions_Priority_BothPrioritiesZero_ConflictingShortcuts_BothPerform
523523
}
524524

525525
[Test]
526-
[Ignore("Enable once we fix this")]
527526
[Category("Actions Priority")]
528527
[TestCase("ctrl", "shift", "x", false)]
529528
[TestCase("ctrl", "shift", "x", true)]

Packages/com.unity.inputsystem/InputSystem/Actions/InputActionState.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,29 +162,29 @@ private void ComputeControlGroupingIfNecessary()
162162

163163
var action = GetActionOrNull(bindingIndex);
164164

165-
var priority = Math.Clamp(action != null ? action.Priority : 0, 0, 65536);
165+
var priority = Math.Clamp(action != null && !disableControlGrouping ? action.Priority : 0, 0, 65536);
166166

167167
controlGroupingAndPriority[i * 2 + 1] = (ushort)priority;
168168

169169
// Compute grouping. If already set, skip.
170170
if (controlGroupingAndPriority[i * 2] == 0)
171171
{
172-
//if (!disableControlGrouping)
173-
//{
174-
for (var n = 0; n < totalControlCount; ++n)
172+
if (!disableControlGrouping)
175173
{
176-
// NOTE: We could compute group numbers based on device index + control offsets
177-
// and thus make them work globally in a stable way. But we'd need a mechanism
178-
// to then determine ordering of actions globally such that it is clear which
179-
// action gets a first shot at an input.
174+
for (var n = 0; n < totalControlCount; ++n)
175+
{
176+
// NOTE: We could compute group numbers based on device index + control offsets
177+
// and thus make them work globally in a stable way. But we'd need a mechanism
178+
// to then determine ordering of actions globally such that it is clear which
179+
// action gets a first shot at an input.
180180

181-
var otherControl = controls[n];
182-
if (control != otherControl)
183-
continue;
181+
var otherControl = controls[n];
182+
if (control != otherControl)
183+
continue;
184184

185-
controlGroupingAndPriority[n * 2] = (ushort)currentGroup;
185+
controlGroupingAndPriority[n * 2] = (ushort)currentGroup;
186+
}
186187
}
187-
//}
188188

189189
controlGroupingAndPriority[i * 2] = (ushort)currentGroup;
190190

0 commit comments

Comments
 (0)