@@ -1566,6 +1566,47 @@ public void Events_HandledPressEdgeInMultiEventFrameShouldNotTriggerActions()
15661566 "Action should trigger normally for non-handled press events" ) ;
15671567 }
15681568
1569+ [ Test ]
1570+ [ Category ( "Events" ) ]
1571+ [ Description ( "ISXB-1097 All WasXxxThisFrame polling APIs should return false when events are" +
1572+ " suppressed via SuppressActionEventNotifications" ) ]
1573+ public void Events_AllWasXxxThisFrameAPIsRespectEventSuppression ( )
1574+ {
1575+ // ISXB-1097: Verifies that all WasXxxThisFrame (and DynamicUpdate variants) consistently
1576+ // return false when the underlying event is handled under SuppressActionEventNotifications.
1577+ // Previously WasReleasedThisFrame and WasCompletedThisFrame were not gated by IsSuppressed.
1578+ var gamepad = InputSystem . AddDevice < Gamepad > ( ) ;
1579+
1580+ var buttonAction = new InputAction ( name : "button" , type : InputActionType . Button ,
1581+ binding : "<Gamepad>/buttonSouth" ) ;
1582+ buttonAction . Enable ( ) ;
1583+
1584+ // Suppress all events.
1585+ InputSystem . onEvent += ( eventPtr , _ ) => { eventPtr . handled = true ; } ;
1586+
1587+ // Press: should suppress WasPressedThisFrame and WasPerformedThisFrame.
1588+ InputSystem . QueueStateEvent ( gamepad , new GamepadState ( ) . WithButton ( GamepadButton . South ) ) ;
1589+ InputSystem . Update ( ) ;
1590+
1591+ Assert . That ( buttonAction . WasPressedThisFrame ( ) , Is . False , "WasPressedThisFrame should be suppressed" ) ;
1592+ Assert . That ( buttonAction . WasPressedThisDynamicUpdate ( ) , Is . False , "WasPressedThisDynamicUpdate should be suppressed" ) ;
1593+ Assert . That ( buttonAction . WasPerformedThisFrame ( ) , Is . False , "WasPerformedThisFrame should be suppressed" ) ;
1594+ Assert . That ( buttonAction . WasPerformedThisDynamicUpdate ( ) , Is . False , "WasPerformedThisDynamicUpdate should be suppressed" ) ;
1595+ // Device state should still reflect the press.
1596+ Assert . That ( gamepad . buttonSouth . isPressed , Is . True ) ;
1597+
1598+ // Release: should suppress WasReleasedThisFrame and WasCompletedThisFrame.
1599+ InputSystem . QueueStateEvent ( gamepad , new GamepadState ( ) ) ;
1600+ InputSystem . Update ( ) ;
1601+
1602+ Assert . That ( buttonAction . WasReleasedThisFrame ( ) , Is . False , "WasReleasedThisFrame should be suppressed" ) ;
1603+ Assert . That ( buttonAction . WasReleasedThisDynamicUpdate ( ) , Is . False , "WasReleasedThisDynamicUpdate should be suppressed" ) ;
1604+ Assert . That ( buttonAction . WasCompletedThisFrame ( ) , Is . False , "WasCompletedThisFrame should be suppressed" ) ;
1605+ Assert . That ( buttonAction . WasCompletedThisDynamicUpdate ( ) , Is . False , "WasCompletedThisDynamicUpdate should be suppressed" ) ;
1606+ // Device state should reflect the release.
1607+ Assert . That ( gamepad . buttonSouth . isPressed , Is . False ) ;
1608+ }
1609+
15691610 [ StructLayout ( LayoutKind . Explicit , Size = 2 ) ]
15701611 struct StateWith2Bytes : IInputStateTypeInfo
15711612 {
0 commit comments