diff options
author | Stijn Buys <ingar@osirion.org> | 2015-01-06 18:51:37 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2015-01-06 18:51:37 +0000 |
commit | 72ee43e9470c6fdbc6ed7ff92b85dfa5062c5762 (patch) | |
tree | 6474fa59066d5212dcd40e3d76652dce35565280 /src/client/keyboard.h | |
parent | 57d958d40af061e83aa99ca12e375e5345836ecd (diff) |
Added separate event handlers for mouse button clicks and mouse wheel movement.
Diffstat (limited to 'src/client/keyboard.h')
-rw-r--r-- | src/client/keyboard.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/keyboard.h b/src/client/keyboard.h index 0742b9c..2ebb568 100644 --- a/src/client/keyboard.h +++ b/src/client/keyboard.h @@ -11,7 +11,7 @@ #include <map> #include <list> -#include "SDL/SDL.h" +#include "SDL2/SDL.h" #include "client/action.h" #include "client/key.h" @@ -29,10 +29,10 @@ public: Keyboard(); ~Keyboard(); - /// find a key on a keysym - Key *find(unsigned int keysym); + /// find a key by scancode + Key *find(unsigned int scancode); - /// find a key on name + /// find a key by name Key *find(std::string const & name); /// bind a string to a key, if str is empty, just list @@ -63,16 +63,16 @@ public: void save_binds() const; /// a key has been pressed - Key *press(unsigned int sym); + Key *press(const unsigned int scancode); /// a key has been pressed Key *press(Key *key); /// a key has been pressed - Key *release(unsigned int sym); + Key *release(const unsigned int scancode); /// convert SDL_keysym to a keystroke - static unsigned int translate_keysym(const int keysym, const int modifiers); + static unsigned int translate_keysym(const unsigned int keysym, const int modifiers); inline Keys & keys() { @@ -80,7 +80,7 @@ public: } private: - Key *add_key(const char *name, const unsigned int keysym, const char ascii = 0, const char *bind = 0); + Key *add_key(const unsigned int scancode, const char *name, const char ascii = 0, const char *bind = 0); Action *add_action(const char *name, Action::Identifier id, const char *description = 0); |