diff options
Diffstat (limited to 'src/client/keyboard.h')
-rw-r--r-- | src/client/keyboard.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/client/keyboard.h b/src/client/keyboard.h index 2ebb568..a665c55 100644 --- a/src/client/keyboard.h +++ b/src/client/keyboard.h @@ -14,6 +14,7 @@ #include "SDL2/SDL.h" #include "client/action.h" +#include "client/control.h" #include "client/key.h" namespace client @@ -25,6 +26,8 @@ public: typedef std::map<unsigned int, Key *> Keys; typedef std::list<Action *> Actions; + + typedef std::list<Control *> Controls; Keyboard(); ~Keyboard(); @@ -57,10 +60,13 @@ public: void list_binds() const; /// load keyboard binds - void load_binds() const; + void load_binds(); /// save keyboard binds void save_binds() const; + + /// load controls + void load_controls(); /// a key has been pressed Key *press(const unsigned int scancode); @@ -78,14 +84,22 @@ public: { return _keys; } + + inline Controls & controls() + { + return _controls; + } private: Key *add_key(const unsigned int scancode, const char *name, const char ascii = 0, const char *bind = 0); Action *add_action(const char *name, Action::Identifier id, const char *description = 0); + + Control *add_control(const char *name, const char *command, const char *keyname = 0); Keys _keys; Actions _actions; + Controls _controls; }; } |