diff options
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Devices/HID/PS2KeyboardDevice.cpp | 2 | ||||
-rw-r--r-- | Kernel/TTY/ConsoleManagement.cpp | 2 | ||||
-rw-r--r-- | Kernel/TTY/ConsoleManagement.h | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/Kernel/Devices/HID/PS2KeyboardDevice.cpp b/Kernel/Devices/HID/PS2KeyboardDevice.cpp index 4504eb8906..608ea94b37 100644 --- a/Kernel/Devices/HID/PS2KeyboardDevice.cpp +++ b/Kernel/Devices/HID/PS2KeyboardDevice.cpp @@ -70,7 +70,7 @@ void PS2KeyboardDevice::irq_handle_byte_read(u8 byte) default: if (m_modifiers & Mod_Alt) { switch (ch) { - case 0x02 ... 0x07: // 1 to 6 + case 0x02 ... 0x01 + ConsoleManagement::s_max_virtual_consoles: g_io_work->queue([this, ch]() { ConsoleManagement::the().switch_to(ch - 0x02); }); diff --git a/Kernel/TTY/ConsoleManagement.cpp b/Kernel/TTY/ConsoleManagement.cpp index b06278b9d8..c1cf6d0d15 100644 --- a/Kernel/TTY/ConsoleManagement.cpp +++ b/Kernel/TTY/ConsoleManagement.cpp @@ -44,7 +44,7 @@ UNMAP_AFTER_INIT ConsoleManagement::ConsoleManagement() UNMAP_AFTER_INIT void ConsoleManagement::initialize() { - for (size_t index = 0; index < 4; index++) { + for (size_t index = 0; index < s_max_virtual_consoles; index++) { // FIXME: Better determine the debug TTY we chose... if (index == 1) { m_consoles.append(VirtualConsole::create_with_preset_log(index, ConsoleDevice::the().logbuffer())); diff --git a/Kernel/TTY/ConsoleManagement.h b/Kernel/TTY/ConsoleManagement.h index 7e466eb23d..e4f3869f05 100644 --- a/Kernel/TTY/ConsoleManagement.h +++ b/Kernel/TTY/ConsoleManagement.h @@ -20,6 +20,8 @@ class ConsoleManagement { public: ConsoleManagement(); + static constexpr unsigned s_max_virtual_consoles = 6; + static bool is_initialized(); static ConsoleManagement& the(); |