Input action not working after unpause game

Use EnhancedInput in UE5.1 C++
Bind action

EnhancedInputComponent->BindAction(PauseAction, ETriggerEvent::Triggered, this, &AMazeRunner::PauseMazeGame);

Action Digital (bool) without modifiers with Pressed Triggers


If use first time method PauseMazeGame works fine. If pause/unpause game with code in hud class (binded to delegate)

void AMazeHUD::OnSetPause(bool Paused)
{
    if (!GetWorld() || !GetWorld()->GetAuthGameMode()) return;
    const auto Controller = GetOwningPlayerController();
    Controller->SetPause(Paused);
    if (Paused)
    {
        Controller->SetInputMode(FInputModeUIOnly());
        Controller->SetShowMouseCursor(true);
        PauseWidget->SetVisibility(ESlateVisibility::Visible);
        HudWidget->SetVisibility(ESlateVisibility::Hidden);
    }
    else
    {
        Controller->SetInputMode(FInputModeGameOnly());
        Controller->SetShowMouseCursor(false);
        PauseWidget->SetVisibility(ESlateVisibility::Hidden);
        HudWidget->SetVisibility(ESlateVisibility::Visible);
    }
}

method PauseMazeGame not work (try log, empty in logs), just not execute

void AMazeRunner::PauseMazeGame()
{
    if (const auto GameMode = Cast<AMazeFirstGameModeBase>(UGameplayStatics::GetGameMode(GetWorld())))
    {
        GameMode->SetPause.Broadcast(true);
    }
}

Unpause from Widget class from UMG button clicked

void UMazePauseWidget::ResumeGame()
{
    if (const auto GameMode = Cast<AMazeFirstGameModeBase>(GetWorld()->GetAuthGameMode()))
    {
        GameMode->SetPause.Broadcast(false);
    }
}

I think what button for this event simple stuck on Triggered state. First press unfreeze button and second work normal. But other actions work fine.
That is, it turns out that after the game is unpaused, it can be paused again only by double-clicking on the button. What is the problem
How fixed this?

If i comment lines with Controller->SetInputMode then button works fine. Whats wrong in my code?

Change Triggers to Down or nothing, work fine.
Bit not once fired

Try debug with showdebug enhancedinput
Screenshot_79
Button work fine without emphasize
When starting the game, this inscription is not. After removal from the pause, it remains, the first press removes and after that only the event is caused again. In this case, with each press, the trigger in the true is shown

Solution found, add this

    Controller->FlushPressedKeys();

after this

Controller->SetInputMode(FInputModeUIOnly());