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.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/client/key.h b/src/client/key.h
new file mode 100644
index 0000000..ece7669
--- /dev/null
+++ b/src/client/key.h
@@ -0,0 +1,42 @@
+/*
+ client/key.h
+ This file is part of the Osirion project and is distributed under
+ the terms and conditions of the GNU General Public License version 2
+*/
+
+#ifndef __INCLUDED_CLIENT_KEY_H__
+#define __INCLUDED_CLIENT_KEY_H__
+
+#include <string>
+
+namespace client {
+
+class Key
+{
+public:
+ Key(const char *name, unsigned int keysym, char ascii=0, const char *bind=0);
+ ~Key();
+
+ 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:
+ unsigned int key_sym;
+ char key_ascii;
+
+ std::string key_name;
+ std::string key_bind;
+
+ float key_pressed;
+};
+
+} // namespace client
+
+#endif // __INCLUDED_CLIENT_KEY_H__