1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:25:07 +00:00

LibGUI: Move shortcut actions from GEventLoop to GApplications.

I'm gonna want to have nested event loops sooner or later, so let's not
pollute GEventLoop with things that are meant to work globally.

This patch also changes key events to pass around their modifiers as a
bitfield all the way around the system instead of breaking them up.
This commit is contained in:
Andreas Kling 2019-03-03 12:32:15 +01:00
parent 725b57fe1f
commit 5e40aa4f1a
11 changed files with 63 additions and 55 deletions

View file

@ -94,10 +94,7 @@ void WSScreen::on_receive_mouse_data(int dx, int dy, bool left_button, bool righ
void WSScreen::on_receive_keyboard_data(KeyEvent kernel_event)
{
auto message = make<WSKeyEvent>(kernel_event.is_press() ? WSMessage::KeyDown : WSMessage::KeyUp, kernel_event.key, kernel_event.character);
message->m_shift = kernel_event.shift();
message->m_ctrl = kernel_event.ctrl();
message->m_alt = kernel_event.alt();
auto message = make<WSKeyEvent>(kernel_event.is_press() ? WSMessage::KeyDown : WSMessage::KeyUp, kernel_event.key, kernel_event.character, kernel_event.modifiers());
WSMessageLoop::the().post_message(WSWindowManager::the(), move(message));
}