diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-22 17:21:35 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-22 17:21:35 +0000 |
commit | 9adc3720cd8fe2ba843d014dbbfe81bf936f9715 (patch) | |
tree | b6610b334a33ede55068f1daa1b869c251548c6f /src/client/key.h | |
parent | bb8b4e081d33f4f1aca6ba23a78842e1fc9cd721 (diff) |
more keyboard handling cleanups
Diffstat (limited to 'src/client/key.h')
-rw-r--r-- | src/client/key.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/key.h b/src/client/key.h index bd6f6bd..6f190c0 100644 --- a/src/client/key.h +++ b/src/client/key.h @@ -7,6 +7,8 @@ #ifndef __INCLUDED_CLIENT_KEY_H__ #define __INCLUDED_CLIENT_KEY_H__ +#include "SDL/SDL.h" + #include <string> namespace client { @@ -20,11 +22,11 @@ class Key { public: /// define a new key - Key(const char *name, unsigned 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=1, Ctrl=2, Alt=3 }; + enum Modifier { None=0, Shift=KMOD_LSHIFT+KMOD_RSHIFT, Ctrl=KMOD_LCTRL + KMOD_RCTRL, Alt=KMOD_LALT+KMOD_RALT }; /// clear all binds void clear(); @@ -44,11 +46,11 @@ public: inline char ascii() const { return key_ascii; } - inline unsigned int sym() const { return key_sym; } + inline int sym() const { return key_sym; } private: std::string key_name; - unsigned int key_sym; + int key_sym; char key_ascii; float key_pressed; |