mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 05:27:45 +00:00
LibGUI+WindowServer: Add new WMEvent
Super+Digit
This adds a keyboard event for Super+0 to Super+9. Later to be consumed in the taskbar. Currently only this keyboard sequence is supported: - Super key down - Digit key down But not this: - Super key down - Digit key down - Digit key up - Digit key down
This commit is contained in:
parent
001b08dec9
commit
6992a07afc
6 changed files with 41 additions and 0 deletions
|
@ -546,6 +546,17 @@ void WindowManager::tell_wms_super_space_key_pressed()
|
|||
});
|
||||
}
|
||||
|
||||
void WindowManager::tell_wms_super_digit_key_pressed(u8 digit)
|
||||
{
|
||||
for_each_window_manager([digit](WMClientConnection& conn) {
|
||||
if (conn.window_id() < 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
conn.async_super_digit_key_pressed(conn.window_id(), digit);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
||||
void WindowManager::tell_wms_current_window_stack_changed()
|
||||
{
|
||||
for_each_window_manager([&](WMClientConnection& conn) {
|
||||
|
@ -1603,6 +1614,12 @@ void WindowManager::process_key_event(KeyEvent& event)
|
|||
tell_wms_super_space_key_pressed();
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.type() == Event::KeyDown && event.key() >= Key_0 && event.key() <= Key_9) {
|
||||
auto digit = event.key() - Key_0;
|
||||
tell_wms_super_digit_key_pressed(digit);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (MenuManager::the().current_menu() && event.key() != Key_Super) {
|
||||
|
|
|
@ -187,6 +187,7 @@ public:
|
|||
void tell_wms_applet_area_size_changed(Gfx::IntSize const&);
|
||||
void tell_wms_super_key_pressed();
|
||||
void tell_wms_super_space_key_pressed();
|
||||
void tell_wms_super_digit_key_pressed(u8);
|
||||
void tell_wms_current_window_stack_changed();
|
||||
|
||||
bool is_active_window_or_accessory(Window&) const;
|
||||
|
|
|
@ -9,6 +9,7 @@ endpoint WindowManagerClient
|
|||
applet_area_size_changed(i32 wm_id, Gfx::IntSize size) =|
|
||||
super_key_pressed(i32 wm_id) =|
|
||||
super_space_key_pressed(i32 wm_id) =|
|
||||
super_digit_key_pressed(i32 wm_id, u8 digit) =|
|
||||
workspace_changed(i32 wm_id, u32 row, u32 column) =|
|
||||
keymap_changed(i32 wm_id, [UTF8] String keymap) =|
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue