1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

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

View file

@ -207,8 +207,10 @@ void Game::update_score(int to_add)
void Game::keydown_event(GUI::KeyEvent& event) 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; return;
}
if (event.shift() && event.key() == KeyCode::Key_F12) { if (event.shift() && event.key() == KeyCode::Key_F12) {
start_game_over_animation(); start_game_over_animation();
@ -220,6 +222,8 @@ void Game::keydown_event(GUI::KeyEvent& event)
if constexpr (SOLITAIRE_DEBUG) { if constexpr (SOLITAIRE_DEBUG) {
dump_layout(); dump_layout();
} }
} else {
event.ignore();
} }
} }