This commit is contained in:
wheremyfoodat 2024-03-20 18:25:12 +02:00
parent e576e64736
commit 1a934fc2c7
7 changed files with 12 additions and 9 deletions

View file

@ -0,0 +1,23 @@
#pragma once
#include <unordered_map>
#include "helpers.hpp"
#include "services/hid.hpp"
struct InputMappings {
using Scancode = u32;
using Container = std::unordered_map<Scancode, u32>;
u32 getMapping(Scancode scancode) const {
auto it = container.find(scancode);
return it != container.end() ? it->second : HID::Keys::Null;
}
void setMapping(Scancode scancode, u32 key) { container[scancode] = key; }
static InputMappings DefaultKeyboardMappings();
private:
Container container;
};