]> git.tdb.fi Git - libs/gui.git/blob - source/input/controlscheme.h
Add classes for storing and applying bindings to controls
[libs/gui.git] / source / input / controlscheme.h
1 #ifndef MSP_INPUT_CONTROLSCHEME_H_
2 #define MSP_INPUT_CONTROLSCHEME_H_
3
4 #include <map>
5 #include <string>
6
7 namespace Msp {
8 namespace Input {
9
10 class Control;
11
12 class ControlScheme
13 {
14 private:
15         std::map<std::string, Control *> controls;
16
17 protected:
18         ControlScheme() = default;
19
20         void add(const std::string &, Control &);
21 public:
22         Control &get(const std::string &) const;
23         Control *find(const std::string &) const;
24         const std::map<std::string, Control *> &get_controls() const { return controls; }
25
26         void reset_edges();
27 };
28
29 } // namespace Input
30 } // namespace Msp
31
32 #endif