diff options
Diffstat (limited to 'src/client/key.h')
-rw-r--r-- | src/client/key.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/client/key.h b/src/client/key.h index d1a8e96..06e0587 100644 --- a/src/client/key.h +++ b/src/client/key.h @@ -41,10 +41,13 @@ public: std::string const & bind(Modifier mod) const; /// first time the key was pressed since previous release - inline float & pressed() { return key_pressed; } + inline float pressed() const { return key_pressed; } - /// last time the key was pressed - inline float & lastpressed() { return key_lastpressed; } + /// last time the key was pressed (includes repeats) + inline float lastpressed() const { return key_lastpressed; } + + /// time the key was pressed when it is released + inline float waspressed() const { return key_waspressed; } inline std::string const & name() const { return key_name; } @@ -52,14 +55,15 @@ public: inline int sym() const { return key_sym; } + float key_pressed; + float key_lastpressed; + float key_waspressed; + private: std::string key_name; int key_sym; char key_ascii; - float key_pressed; - float key_lastpressed; - std::string key_bind; std::string key_bind_shift; std::string key_bind_ctrl; |