Kernel: Keymaps can now be loaded from files
This commit is contained in:
30
kernel/include/kernel/Input/KeyboardLayout.h
Normal file
30
kernel/include/kernel/Input/KeyboardLayout.h
Normal 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>;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace Kernel::Input::KeyboardLayout
|
||||
{
|
||||
|
||||
void initialize_fi();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user