Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/key.h')
-rw-r--r--src/client/key.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/client/key.h b/src/client/key.h
index 06e0587..3bb3e2b 100644
--- a/src/client/key.h
+++ b/src/client/key.h
@@ -11,7 +11,8 @@
#include <string>
-namespace client {
+namespace client
+{
/// a pressable key
/**
@@ -22,11 +23,11 @@ class Key
{
public:
/// define a new key
- Key(const char *name, int keysym, char ascii=0, const char *bind=0);
+ Key(const char *name, int keysym, char ascii = 0, const char *bind = 0);
~Key();
-
+
/// key modifiers
- enum Modifier { None=0, Shift=KMOD_LSHIFT+KMOD_RSHIFT, Ctrl=KMOD_LCTRL + KMOD_RCTRL, Alt=KMOD_LALT+KMOD_RALT };
+ enum Modifier { None = 0, Shift = KMOD_LSHIFT + KMOD_RSHIFT, Ctrl = KMOD_LCTRL + KMOD_RCTRL, Alt = KMOD_LALT + KMOD_RALT };
/// clear all binds
void clear();
@@ -41,19 +42,31 @@ public:
std::string const & bind(Modifier mod) const;
/// first time the key was pressed since previous release
- inline float pressed() const { return key_pressed; }
+ inline float pressed() const {
+ return key_pressed;
+ }
/// last time the key was pressed (includes repeats)
- inline float lastpressed() const { return key_lastpressed; }
+ 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; }
+ inline float waspressed() const {
+ return key_waspressed;
+ }
+
+ inline std::string const & name() const {
+ return key_name;
+ }
- inline char ascii() const { return key_ascii; }
+ inline char ascii() const {
+ return key_ascii;
+ }
- inline int sym() const { return key_sym; }
+ inline int sym() const {
+ return key_sym;
+ }
float key_pressed;
float key_lastpressed;