Kernel: Keymaps can now be loaded from files

This commit is contained in:
2024-01-10 14:43:19 +02:00
parent e6d42e5c45
commit 8f89519bcf
7 changed files with 387 additions and 383 deletions

View File

@@ -0,0 +1,30 @@
#pragma once
#include <BAN/Array.h>
#include <BAN/UniqPtr.h>
#include <kernel/Input/KeyEvent.h>
namespace Kernel::Input
{
class KeyboardLayout
{
public:
static BAN::ErrorOr<void> initialize();
static KeyboardLayout& get();
Key get_key_from_event(KeyEvent);
BAN::ErrorOr<void> load_from_file(BAN::StringView path);
private:
KeyboardLayout();
private:
BAN::Array<Key, 0xFF> m_keycode_to_key_normal;
BAN::Array<Key, 0xFF> m_keycode_to_key_shift;
BAN::Array<Key, 0xFF> m_keycode_to_key_altgr;
friend class BAN::UniqPtr<KeyboardLayout>;
};
}

View File

@@ -1,8 +0,0 @@
#pragma once
namespace Kernel::Input::KeyboardLayout
{
void initialize_fi();
}