Files
jminos/src/GraphicalUI/Keybinds.h
2025-03-22 10:49:55 +01:00

33 lines
613 B
C++

#pragma once
#include "../Core/Action.h"
#include <map>
#include <vector>
#include <SFML/Graphics.hpp>
using sfKey = sf::Keyboard::Key;
class Keybinds {
private:
std::map<Action, std::vector<sfKey>> keybinds;
public:
Keybinds();
void loadKeybindsFromFile();
void saveKeybindsToFile() const;
void resetCustomLayoutFile() const;
void addKey(Action action, sfKey key);
void clearKeys(Action action);
const std::vector<Action>& getActions(sfKey key) const;
const std::vector<sfKey>& getKeybinds(Action action) const;
};