From 6817dec0b405b325a2762e352ad2a5916c24542a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 31 Jul 2016 14:14:25 +0200 Subject: Added reset_controls function to revert to the default keyboard configuration, don't override unbound keys with default binds. --- src/client/control.h | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/client/control.h') diff --git a/src/client/control.h b/src/client/control.h index bf30418..5f72aa1 100644 --- a/src/client/control.h +++ b/src/client/control.h @@ -22,21 +22,41 @@ public: Control(const char *name, const char *command, const char * keyname = 0); ~Control(); + /** + * @brief name of this control + * */ inline const std::string &name() const { return _name; } - - inline const std::string & command() const + + /** + * @brief the command executed by this control + */ + inline const std::string &command() const { return _command; } - - inline const std::string & keyname() const + + /** + * @brief the currently assigned to this control. + * */ + inline const std::string &keyname() const { return _keyname; } + /** + * @brief the default key assigned to this control. + * */ + inline const std::string &defaultkeyname() const + { + return _defaultkeyname; + } + + /** + * @brief assign a key to this control + * */ inline void set_keyname(const std::string &keyname) { _keyname.assign(keyname); @@ -46,6 +66,7 @@ private: std::string _name; std::string _command; std::string _keyname; + std::string _defaultkeyname; }; } // namespace client -- cgit v1.2.3