Skip to content

Commit eaa9295

Browse files
committed
Removed policy property from InputSystem and made the enum type internal.
1 parent 74ef71a commit eaa9295

File tree

5 files changed

+23
-29
lines changed

5 files changed

+23
-29
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,8 +2124,8 @@ public RebindingOperation Start()
21242124

21252125
m_StartTime = InputState.currentTime;
21262126

2127-
m_SavedInputEventHandledPolicy = InputSystem.inputEventHandledPolicy;
2128-
InputSystem.inputEventHandledPolicy = m_TargetInputEventHandledPolicy;
2127+
m_SavedInputEventHandledPolicy = InputSystem.s_Manager.inputEventHandledPolicy;
2128+
InputSystem.s_Manager.inputEventHandledPolicy = m_TargetInputEventHandledPolicy;
21292129

21302130
if (m_WaitSecondsAfterMatch > 0 || m_Timeout > 0)
21312131
{
@@ -2627,7 +2627,7 @@ private void ResetAfterMatchCompleted()
26272627
UnhookOnEvent();
26282628
UnhookOnAfterUpdate();
26292629

2630-
InputSystem.inputEventHandledPolicy = m_SavedInputEventHandledPolicy;
2630+
InputSystem.s_Manager.inputEventHandledPolicy = m_SavedInputEventHandledPolicy;
26312631
}
26322632

26332633
private void ThrowIfRebindInProgress()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ private void ProcessControlStateChange(int mapIndex, int controlIndex, int bindi
15211521

15221522
// Check if we should suppress interaction processing
15231523
var suppressInteractionProcessing = (eventPtr != null) && eventPtr.handled &&
1524-
InputSystem.inputEventHandledPolicy == InputEventHandledPolicy.SuppressActionUpdates;
1524+
InputSystem.s_Manager.inputEventHandledPolicy == InputEventHandledPolicy.SuppressActionUpdates;
15251525

15261526
// Check if we have multiple concurrent actuations on the same action. This may lead us
15271527
// to ignore certain inputs (e.g. when we get an input of lesser magnitude while already having

Packages/com.unity.inputsystem/InputSystem/Events/InputEventHandledPolicy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace UnityEngine.InputSystem.LowLevel
44
/// Policy defining how the Input System will react to <see cref="InputEvent"/> instances marked as
55
/// <see cref="InputEvent.handled"/> (Or marked handled via <see cref="InputEventPtr.handled"/>).
66
/// </summary>
7-
public enum InputEventHandledPolicy
7+
internal enum InputEventHandledPolicy
88
{
99
/// <summary>
1010
/// Input events will be discarded directly and not propagate for state changes.

Packages/com.unity.inputsystem/InputSystem/InputManager.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,24 @@ public float pollingFrequency
210210
}
211211
}
212212

213+
/// <summary>
214+
/// The policy to be applied when processing input events that has been marked as "handled" by setting
215+
/// <see cref="InputEvent.handled"/> or <see cref="InputEventPtr.handled"/> to true.
216+
/// </summary>
217+
/// <remarks>
218+
/// The default setting of this property is <see cref="InputEventHandledPolicy.SuppressStateUpdates"/> which
219+
/// implies that events are completely suppressed which means that associated state will not be updated.
220+
/// Hence, any state dependent classes such as <see cref="InputAction"/> or associated interactions will
221+
/// not be updated either. A side-effect of this setting is that succeeding events that are not suppressed
222+
/// may trigger new unexpected events since they may trigger state changes due to monitoring instances not
223+
/// seeing previous changes.
224+
///
225+
/// The setting <see cref="InputEventHandledPolicy.SuppressActionUpdates"/> will instead allow state change
226+
/// propagation to happen, including updating interaction state, but will instead suppress any associated
227+
/// notifications.
228+
/// </remarks>
229+
/// <exception cref="ArgumentOutOfRangeException">If attempting to set this property to an unsupported
230+
/// value.</exception>
213231
internal InputEventHandledPolicy inputEventHandledPolicy
214232
{
215233
get => m_InputEventHandledPolicy;

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,30 +1382,6 @@ public static float pollingFrequency
13821382
set => s_Manager.pollingFrequency = value;
13831383
}
13841384

1385-
/// <summary>
1386-
/// The policy to be applied when processing input events that has been marked as "handled" by setting
1387-
/// <see cref="InputEvent.handled"/> or <see cref="InputEventPtr.handled"/> to true.
1388-
/// </summary>
1389-
/// <remarks>
1390-
/// The default setting of this property is <see cref="InputEventHandledPolicy.SuppressStateUpdates"/> which
1391-
/// implies that events are completely suppressed which means that associated state will not be updated.
1392-
/// Hence, any state dependent classes such as <see cref="InputAction"/> or associated interactions will
1393-
/// not be updated either. A side-effect of this setting is that succeeding events that are not suppressed
1394-
/// may trigger new unexpected events since they may trigger state changes due to monitoring instances not
1395-
/// seeing previous changes.
1396-
///
1397-
/// The setting <see cref="InputEventHandledPolicy.SuppressActionUpdates"/> will instead allow state change
1398-
/// propagation to happen, including updating interaction state, but will instead suppress any associated
1399-
/// notifications.
1400-
/// </remarks>
1401-
/// <exception cref="ArgumentOutOfRangeException">If attempting to set this property to an unsupported
1402-
/// value.</exception>
1403-
public static InputEventHandledPolicy inputEventHandledPolicy
1404-
{
1405-
get => s_Manager.inputEventHandledPolicy;
1406-
set => s_Manager.inputEventHandledPolicy = value;
1407-
}
1408-
14091385
/// <summary>
14101386
/// Add a new device by instantiating the given device layout.
14111387
/// </summary>

0 commit comments

Comments
 (0)