1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

WindowManager: Basic support for system keymap switching

This commit is contained in:
Timur Sultanov 2022-01-18 16:00:49 +03:00 committed by Andreas Kling
parent 181d1e2dd6
commit 68a01f0e27
6 changed files with 150 additions and 3 deletions

View file

@ -36,6 +36,7 @@ WindowManager& WindowManager::the()
WindowManager::WindowManager(Gfx::PaletteImpl const& palette)
: m_switcher(WindowSwitcher::construct())
, m_keymap_switcher(KeymapSwitcher::construct())
, m_palette(palette)
{
s_the = this;
@ -1557,6 +1558,11 @@ void WindowManager::process_key_event(KeyEvent& event)
return;
}
if (event.type() == Event::KeyDown && (event.modifiers() == (Mod_Alt | Mod_Shift) && (event.key() == Key_Shift || event.key() == Key_Alt))) {
m_keymap_switcher->next_keymap();
return;
}
if (event.type() == Event::KeyDown && (event.modifiers() == (Mod_Ctrl | Mod_Alt) || event.modifiers() == (Mod_Ctrl | Mod_Shift | Mod_Alt)) && (window_stack_columns() > 1 || window_stack_rows() > 1)) {
auto& current_stack = current_window_stack();
auto row = current_stack.row();