Unity 2022.3.49f1, Input system 1.11.1
as shown

Action Attack is bound to the J key of the keyboard, the left mouse button, and the X button of the xbox controller.
void OnEnable()
{
InputActs.Player.Attack.started += OnAttackStarted;
InputActs.Player.Attack.canceled += OnAttackCanceled;
}
private void OnAttackStarted(InputAction.CallbackContext context)
{
Debug.Log("Attack started");
}
private void OnAttackCanceled(InputAction.CallbackContext context)
{
Debug.Log("Attack canceled");
}
I have listened to the Attack’s started and canceled events in my code.
My question is, how can I get the gamepad button to also trigger the canceled event only when it is released
