00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef INPUT_HH_
00018 # define INPUT_HH_
00019
00020 # include <SDL.h>
00021 # include "tools.hh"
00022
00040 class Input
00041 {
00042 public:
00043 Input();
00044 ~Input();
00045
00046 static Input* getInst();
00047
00049 void reset();
00050
00052 void update(SDL_Event& event);
00053
00056 bool isModDown(int mod) const;
00058 bool isModPressed(int mod) const;
00059
00063 bool lockKeyboard(const std::string& lock_id);
00066 bool unlockKeyboard(const std::string& lock_id);
00068 bool isKeyboardLocked() const;
00069
00070 const std::string& getString() const;
00071
00072 Point mouse_delta_;
00073 Point mouse_;
00074 bool button_[10];
00075 bool button_pressed_[10];
00076 bool key_[SDLK_LAST];
00077 bool key_pressed_[SDLK_LAST];
00078
00079 private:
00080 int modifier_;
00081 int modifier_pressed_;
00082
00083 std::string lock_id_;
00084 bool key_lock_[SDLK_LAST];
00085 bool key_pressed_lock_[SDLK_LAST];
00086 std::string string_;
00087 std::string string_lock_;
00088
00089 static Input* inst_;
00090 };
00091
00092 #endif