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

Taskbar+Desktop: Add super+D keyboard shortcut

This shortcut has the same effect as pressing the "Show Desktop" button
in the taskbar. This shortcut already exists in Windows.
This commit is contained in:
Olivier De Cannière 2022-06-01 13:40:43 +02:00 committed by Andreas Kling
parent 12682f0bcc
commit 5a3321b899
7 changed files with 38 additions and 0 deletions

View file

@ -64,6 +64,12 @@ void ConnectionToWindowManagerServer::super_space_key_pressed(i32 wm_id)
Core::EventLoop::current().post_event(*window, make<WMSuperSpaceKeyPressedEvent>(wm_id));
}
void ConnectionToWindowManagerServer::super_d_key_pressed(i32 wm_id)
{
if (auto* window = Window::from_window_id(wm_id))
Core::EventLoop::current().post_event(*window, make<WMSuperDKeyPressedEvent>(wm_id));
}
void ConnectionToWindowManagerServer::super_digit_key_pressed(i32 wm_id, u8 digit)
{
if (auto* window = Window::from_window_id(wm_id))

View file

@ -34,6 +34,7 @@ private:
virtual void applet_area_size_changed(i32, Gfx::IntSize const&) override;
virtual void super_key_pressed(i32) override;
virtual void super_space_key_pressed(i32) override;
virtual void super_d_key_pressed(i32) override;
virtual void super_digit_key_pressed(i32, u8) override;
virtual void workspace_changed(i32, u32, u32) override;
virtual void keymap_changed(i32, String const&) override;

View file

@ -67,6 +67,7 @@ public:
WM_AppletAreaSizeChanged,
WM_SuperKeyPressed,
WM_SuperSpaceKeyPressed,
WM_SuperDKeyPressed,
WM_SuperDigitKeyPressed,
WM_WorkspaceChanged,
WM_KeymapChanged,
@ -117,6 +118,14 @@ public:
}
};
class WMSuperDKeyPressedEvent : public WMEvent {
public:
explicit WMSuperDKeyPressedEvent(int client_id)
: WMEvent(Event::Type::WM_SuperDKeyPressed, client_id, 0)
{
}
};
class WMSuperDigitKeyPressedEvent : public WMEvent {
public:
WMSuperDigitKeyPressedEvent(int client_id, u8 digit)