mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 09:36:08 +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
Notes:
sideshowbarker
2024-07-16 20:51:53 +09:00
Author: https://github.com/AtkinsSJ
Commit: c9fb3e07d2
Pull-request: https://github.com/SerenityOS/serenity/pull/23139
1 changed files with 3 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue