Skip to content

Commit 1ff7385

Browse files
committed
sort out controls which are not contained in event
1 parent a32fbdb commit 1ff7385

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Packages/com.unity.inputsystem/InputSystem/Controls/InputControlExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,8 @@ public static InputControl GetFirstButtonPressOrNull(this InputEventPtr eventPtr
11141114

11151115
foreach (var control in eventPtr.EnumerateControls(Enumerate.IgnoreControlsInDefaultState, magnitudeThreshold: magnitude))
11161116
{
1117+
if (!control.HasValueChangeInEvent(eventPtr))
1118+
continue;
11171119
if (buttonControlsOnly && !control.isButton)
11181120
continue;
11191121
return control;

0 commit comments

Comments
 (0)