Skip to content

Commit 6a738d2

Browse files
committed
FIX: Fixed inconsistent suppression behaviour between wasPressedThisFrame, wasPerformedThisFrame, wasReleasedThisFrame, wasCompletedThisFrame.
1 parent aec3bee commit 6a738d2

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Fixed
1111

1212
- Fixed `InputEventPtr.handled` not preventing actions from triggering when switching devices. The default event handled policy has been changed from `SuppressStateUpdates` (now deprecated) to `SuppressActionEventNotifications`, which keeps device state synchronized while suppressing action callbacks for handled events. [ISXB-1097](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1097)
13+
- Fixed `InputAction.WasReleasedThisFrame()`, `WasReleasedThisDynamicUpdate()`, `WasCompletedThisFrame()`, and `WasCompletedThisDynamicUpdate()` not respecting event suppression, making them inconsistent with `WasPressedThisFrame()` and `WasPerformedThisFrame()`. [ISXB-1097](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1097)
1314
- Fixed a `NullReferenceException` thrown when removing all action maps [UUM-137116](https://jira.unity3d.com/browse/UUM-137116)
1415
- Simplified default setting messaging by consolidating repetitive messages into a single HelpBox.
1516
- Fixed a `NullPointerReferenceException` thrown in `InputManagerStateMonitors.FireStateChangeNotifications` logging by adding validation [UUM-136095].

Packages/com.unity.inputsystem/InputSystem/Runtime/Actions/InputAction.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ public unsafe bool WasPressedThisFrame()
13001300
public unsafe bool WasPressedThisDynamicUpdate()
13011301
{
13021302
var state = GetOrCreateActionMap().m_State;
1303-
if (state != null)
1303+
if (state != null && !state.IsSuppressed)
13041304
{
13051305
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
13061306
return actionStatePtr->framePressed == ExpectedFrame();
@@ -1350,7 +1350,7 @@ public unsafe bool WasPressedThisDynamicUpdate()
13501350
public unsafe bool WasReleasedThisFrame()
13511351
{
13521352
var state = GetOrCreateActionMap().m_State;
1353-
if (state != null)
1353+
if (state != null && !state.IsSuppressed)
13541354
{
13551355
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
13561356
var currentUpdateStep = InputUpdate.s_UpdateStepCount;
@@ -1391,7 +1391,7 @@ public unsafe bool WasReleasedThisFrame()
13911391
public unsafe bool WasReleasedThisDynamicUpdate()
13921392
{
13931393
var state = GetOrCreateActionMap().m_State;
1394-
if (state != null)
1394+
if (state != null && !state.IsSuppressed)
13951395
{
13961396
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
13971397
return actionStatePtr->frameReleased == ExpectedFrame();
@@ -1490,7 +1490,7 @@ public unsafe bool WasPerformedThisDynamicUpdate()
14901490
{
14911491
var state = GetOrCreateActionMap().m_State;
14921492

1493-
if (state != null)
1493+
if (state != null && !state.IsSuppressed)
14941494
{
14951495
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
14961496
return actionStatePtr->framePerformed == ExpectedFrame();
@@ -1571,7 +1571,7 @@ public unsafe bool WasCompletedThisFrame()
15711571
{
15721572
var state = GetOrCreateActionMap().m_State;
15731573

1574-
if (state != null)
1574+
if (state != null && !state.IsSuppressed)
15751575
{
15761576
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
15771577
var currentUpdateStep = InputUpdate.s_UpdateStepCount;
@@ -1612,7 +1612,7 @@ public unsafe bool WasCompletedThisDynamicUpdate()
16121612
{
16131613
var state = GetOrCreateActionMap().m_State;
16141614

1615-
if (state != null)
1615+
if (state != null && !state.IsSuppressed)
16161616
{
16171617
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
16181618
return actionStatePtr->frameCompleted == ExpectedFrame();

0 commit comments

Comments
 (0)