]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/controlscheme.h
Add classes for storing and applying bindings to controls
[libs/gui.git] / source / input / controlscheme.h
diff --git a/source/input/controlscheme.h b/source/input/controlscheme.h
new file mode 100644 (file)
index 0000000..dabcec2
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef MSP_INPUT_CONTROLSCHEME_H_
+#define MSP_INPUT_CONTROLSCHEME_H_
+
+#include <map>
+#include <string>
+
+namespace Msp {
+namespace Input {
+
+class Control;
+
+class ControlScheme
+{
+private:
+       std::map<std::string, Control *> controls;
+
+protected:
+       ControlScheme() = default;
+
+       void add(const std::string &, Control &);
+public:
+       Control &get(const std::string &) const;
+       Control *find(const std::string &) const;
+       const std::map<std::string, Control *> &get_controls() const { return controls; }
+
+       void reset_edges();
+};
+
+} // namespace Input
+} // namespace Msp
+
+#endif