GlobalInputs F1-F12 + Escape, Screen sense destruir finestra, escalat al GPU, presets i fons canvas (v0.11.0)

This commit is contained in:
JailDesigner committed 2026-04-19 14:27:16 +02:00
1 parent 837eb73398
commit 297dc85e47
23 files changed
+653 -34

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <SDL3/SDL.h>
#include <string>
#include <unordered_map>
// Mapeig id → SDL_Scancode carregat des de data/input/keys.yaml. Consumit
// per GlobalInputs i (en el futur) per menús de remapat. No té cap cost
// global: si la clau no existeix, retorna SDL_SCANCODE_UNKNOWN i GlobalInputs
// ignora l'acció. D'aquesta manera podem afegir nous bindings al YAML sense
// tocar codi mentre els handlers continuen funcionant.
class KeyConfig {
public:
static auto get() -> KeyConfig&;
KeyConfig(const KeyConfig&) = delete;
KeyConfig(KeyConfig&&) = delete;
auto operator=(const KeyConfig&) -> KeyConfig& = delete;
auto operator=(KeyConfig&&) -> KeyConfig& = delete;
void load(const std::string& file_path);
[[nodiscard]] auto scancode(const std::string& id) const -> SDL_Scancode;
private:
KeyConfig() = default;
~KeyConfig() = default;
std::unordered_map<std::string, SDL_Scancode> bindings_;
};