How to Lock and Unlock Player's Input?

I’m making a system to lock the player’s input for a few seconds and release it.
I’m using unity input system and its behavior is set to ‘Invoke Unity Events’.
It seems like that code below only reads when the player gives new input.

public void OnMoveInput(InputAction.CallbackContext context)
{
    movementInput = context.ReadValue<Vector2>();
    normInputX = preventInputX ? fixedInputX : Mathf.RoundToInt(movementInput.x);
    normInputY = Mathf.RoundToInt(movementInput.y);
}

So the problem I’m having is when player’s input is unlocked, unless the player presses the button again, normInputX is still set to fixedInputX and doesn’t change.
Is there a way to read button again that player is pressing by function call or should I just make my input system to read every frame?

I think some part of this is going to have to be polling on a per-frame basis.

One thing you could do is check the phase of the input: Enum InputActionPhase | Input System | 1.7.0

So maybe when the user cancels input you start a timer for n seconds.

Though you might be able to get more finer control by rather than using the PlayerInput component, instead hooking into directly with your InputAction’s callbacks, or simply polling the inputs on a per-frame basis (it’s not as bad as some folks make it out to be).

I totally just forgot about this thread and currently I wrote a code like below. I’m sure that there will be a much better way than what I did below, but as for me, it was my best effort.

public Vector2 movementInput { get; private set; }
public int normInputX { get; private set; }
public int normInputY { get; private set; }
public int actualInputX { get; private set; }
public int fixedInputX { get; private set; }
public bool preventInputX { get; private set; }

public void OnMoveInput(InputAction.CallbackContext context)
{
    movementInput = context.ReadValue<Vector2>();
    actualInputX = Mathf.RoundToInt(movementInput.x);
    normInputX = preventInputX ? fixedInputX : actualInputX;
    normInputY = Mathf.RoundToInt(movementInput.y);
}

public void PreventInputX(int facingDirection)
{
    if (preventInputX == false)
    {
        fixedInputX = facingDirection;
        normInputX = facingDirection;
        preventInputX = true;
    }
}

public void AvailInputX()
{
    if (preventInputX)
    {
        preventInputX = false;
        normInputX = actualInputX;
    }
}

…By the way, how can I change my tag from Question to Solved?