LibGUI: Only activate keyboard shortcuts on KeyDown, not KeyUp.

This commit is contained in:
Andreas Kling 2019-03-08 01:59:07 +01:00
parent 1e0971c8b4
commit 77359a5360
Notes: sideshowbarker 2024-07-19 15:07:38 +09:00

View file

@ -158,9 +158,11 @@ void GEventLoop::handle_key_event(const WSAPI_ServerMessage& event, GWindow& win
if (event.key.character != '\0')
key_event->m_text = String(&event.key.character, 1);
if (auto* action = GApplication::the().action_for_key_event(*key_event)) {
action->activate();
return;
if (event.type == WSAPI_ServerMessage::Type::KeyDown) {
if (auto* action = GApplication::the().action_for_key_event(*key_event)) {
action->activate();
return;
}
}
post_event(window, move(key_event));
}