From 980c5c41dc8e88ab3e7a5751348a92a0662a2ea4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 21 Jul 2008 22:03:26 +0000 Subject: prepare keybinds for modifier keys, fix for the camera clipping issue --- src/client/key.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/client/key.h') diff --git a/src/client/key.h b/src/client/key.h index ece7669..344e1fa 100644 --- a/src/client/key.h +++ b/src/client/key.h @@ -14,27 +14,44 @@ namespace client { class Key { public: + /// define a new key Key(const char *name, unsigned int keysym, char ascii=0, const char *bind=0); ~Key(); + + /// key modifiers + enum Modifier { None=0, Shift=1, Ctrl=2, Alt=3 }; + + /// clear all binds + void clear(); + + /// set the bind for a specific modifier + void assign(Modifier mod, const char *bind); + + /// clear the bind for a specific modifier + void clear(Modifier mod); + + /// return the bind for a specific modifier + std::string const & bind(Modifier mod) const; inline float & pressed() { return key_pressed; } inline std::string const & name() const { return key_name; } - inline std::string & bind() { return key_bind; } - inline char ascii() const { return key_ascii; } inline unsigned int sym() const { return key_sym; } private: + std::string key_name; unsigned int key_sym; char key_ascii; - std::string key_name; - std::string key_bind; - float key_pressed; + + std::string key_bind; + std::string key_bind_shift; + std::string key_bind_ctrl; + std::string key_bind_alt; }; } // namespace client -- cgit v1.2.3