mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
LibGUI+WindowServer: Add new WMEvent Super+Space
To make Assistant useful we need a way to quickly trigger it. I've added a new specialized event coming from the window server for when a user is holding down 'Super' and hits 'Space'. The Taskbar will be able to listen for this event and spawn a new instance of the Assistant if it's not already running.
This commit is contained in:
parent
66c13edb98
commit
4f11138e8e
7 changed files with 38 additions and 0 deletions
|
@ -376,6 +376,17 @@ void WindowManager::tell_wms_super_key_pressed()
|
|||
});
|
||||
}
|
||||
|
||||
void WindowManager::tell_wms_super_space_key_pressed()
|
||||
{
|
||||
for_each_window_manager([](WMClientConnection& conn) {
|
||||
if (conn.window_id() < 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
conn.async_super_space_key_pressed(conn.window_id());
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
||||
static bool window_type_has_title(WindowType type)
|
||||
{
|
||||
return type == WindowType::Normal || type == WindowType::ToolWindow;
|
||||
|
@ -1247,6 +1258,11 @@ void WindowManager::process_key_event(KeyEvent& event)
|
|||
tell_wms_super_key_pressed();
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.type() == Event::KeyDown && event.key() == Key_Space) {
|
||||
tell_wms_super_space_key_pressed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (MenuManager::the().current_menu() && event.key() != Key_Super) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue