Skip to content

Commit

Permalink
BrickGame: Make action shortcuts work when the game is paused
Browse files Browse the repository at this point in the history
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. :^)
  • Loading branch information
AtkinsSJ committed Feb 11, 2024
1 parent 9868728 commit c9fb3e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Userland/Games/BrickGame/BrickGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit c9fb3e0

Please sign in to comment.