mirror of
https://github.com/izzy2lost/Panda3DS.git
synced 2026-03-10 12:38:37 -07:00
* Configurable keyboard mappings * Cleanup * Cleanup * Biggest mistake of my career * format * Fix naming convention --------- Co-authored-by: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
23 lines
503 B
C++
23 lines
503 B
C++
#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;
|
|
};
|