mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
WindowServer: Open window menu on Alt+Space
Adds a keyboard shortcut Alt+Space that opens the window menu.
This commit is contained in:
parent
967cd6afd2
commit
5d14636b95
1 changed files with 5 additions and 0 deletions
|
@ -454,6 +454,11 @@ void Window::event(Core::Event& event)
|
||||||
|
|
||||||
void Window::handle_keydown_event(const KeyEvent& event)
|
void Window::handle_keydown_event(const KeyEvent& event)
|
||||||
{
|
{
|
||||||
|
if (event.modifiers() == Mod_Alt && event.key() == Key_Space && type() == WindowType::Normal && !is_frameless()) {
|
||||||
|
auto position = frame().titlebar_rect().bottom_left().translated(frame().rect().location());
|
||||||
|
popup_window_menu(position, WindowMenuDefaultAction::Close);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (event.modifiers() == Mod_Alt && event.code_point() && menubar()) {
|
if (event.modifiers() == Mod_Alt && event.code_point() && menubar()) {
|
||||||
Menu* menu_to_open = nullptr;
|
Menu* menu_to_open = nullptr;
|
||||||
menubar()->for_each_menu([&](Menu& menu) {
|
menubar()->for_each_menu([&](Menu& menu) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue