BrickGame: Make action shortcuts work when the game is paused

We previously never called event.ignore(), so the keydown event for F2
or F11 etc would be consumed by the BrickGame widget instead of
bubbling up. Now you can start a new game, or escape fullscreen mode,
even if you've paused the game. :^)
This commit is contained in:
Sam Atkins 2024-02-09 17:06:48 +00:00 committed by Sam Atkins
commit c9fb3e07d2
Notes: sideshowbarker 2024-07-16 20:51:53 +09:00

View file

@ -509,8 +509,10 @@ void BrickGame::keydown_event(GUI::KeyEvent& event)
break;
}
if (m_brick_game->state() == Bricks::GameState::Paused)
if (m_brick_game->state() == Bricks::GameState::Paused) {
event.ignore();
return;
}
Bricks::RenderRequest render_request { Bricks::RenderRequest::SkipRender };
switch (event.key()) {