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
Notes:
sideshowbarker
2024-07-19 17:27:47 +09:00
Author: https://github.com/codebutler Commit: https://github.com/SerenityOS/serenity/commit/5d14636b956 Pull-request: https://github.com/SerenityOS/serenity/pull/6975 Reviewed-by: https://github.com/awesomekling
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)
|
||||
{
|
||||
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()) {
|
||||
Menu* menu_to_open = nullptr;
|
||||
menubar()->for_each_menu([&](Menu& menu) {
|
||||
|
|
Loading…
Add table
Reference in a new issue