diff options
author | Stijn Buys <ingar@osirion.org> | 2015-02-08 21:51:53 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2015-02-08 21:51:53 +0000 |
commit | 77d877160d5c3b8a7e9c30e81bd6ca1f4060b5f9 (patch) | |
tree | 7e3c8de8f0aeea2e03b086b5ff1a3c7b60892e25 /src/client/keyboard.h | |
parent | 4fdf7de0f1454966754bb22d1828fc2b69c172f4 (diff) |
Added a menu to configure key controls.
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; }; } |