mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
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:
parent
986872800e
commit
c9fb3e07d2
1 changed files with 3 additions and 1 deletions
|
@ -509,8 +509,10 @@ void BrickGame::keydown_event(GUI::KeyEvent& event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_brick_game->state() == Bricks::GameState::Paused)
|
if (m_brick_game->state() == Bricks::GameState::Paused) {
|
||||||
|
event.ignore();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Bricks::RenderRequest render_request { Bricks::RenderRequest::SkipRender };
|
Bricks::RenderRequest render_request { Bricks::RenderRequest::SkipRender };
|
||||||
switch (event.key()) {
|
switch (event.key()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue