Solitaire: Ignore unhandled keydown events

This makes Action shortcuts work again. :^)
This commit is contained in:
Sam Atkins 2022-12-14 15:36:06 +00:00 committed by Linus Groh
parent 9665f41979
commit 0bf37b8763
Notes: sideshowbarker 2024-07-17 06:35:23 +09:00

View file

@ -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();
@ -220,6 +222,8 @@ void Game::keydown_event(GUI::KeyEvent& event)
if constexpr (SOLITAIRE_DEBUG) {
dump_layout();
}
} else {
event.ignore();
}
}