Skip to content

Commit

Permalink
Solitaire: Ignore unhandled keydown events
Browse files Browse the repository at this point in the history
This makes Action shortcuts work again. :^)
  • Loading branch information
AtkinsSJ authored and linusg committed Dec 14, 2022
1 parent 9665f41 commit 0bf37b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Userland/Games/Solitaire/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ void Game::update_score(int to_add)

void Game::keydown_event(GUI::KeyEvent& event)
{
if (is_moving_cards() || m_new_game_animation || m_game_over_animation)
if (is_moving_cards() || m_new_game_animation || m_game_over_animation) {
event.ignore();
return;
}

if (event.shift() && event.key() == KeyCode::Key_F12) {
start_game_over_animation();
Expand All @@ -220,6 +222,8 @@ void Game::keydown_event(GUI::KeyEvent& event)
if constexpr (SOLITAIRE_DEBUG) {
dump_layout();
}
} else {
event.ignore();
}
}

Expand Down

0 comments on commit 0bf37b8

Please sign in to comment.