00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024
00025 #ifndef SFML_INPUT_HPP
00026 #define SFML_INPUT_HPP
00027
00029
00031 #include <SFML/Config.hpp>
00032 #include <SFML/System/NonCopyable.hpp>
00033 #include <SFML/Window/Event.hpp>
00034 #include <SFML/Window/WindowListener.hpp>
00035
00036
00037 namespace sf
00038 {
00044 class SFML_API Input : public WindowListener, NonCopyable
00045 {
00046 public :
00047
00052 Input();
00053
00062 bool IsKeyDown(Key::Code KeyCode) const;
00063
00072 bool IsMouseButtonDown(Mouse::Button Button) const;
00073
00083 bool IsJoystickButtonDown(unsigned int JoyId, unsigned int Button) const;
00084
00091 unsigned int GetMouseX() const;
00092
00099 unsigned int GetMouseY() const;
00100
00109 int GetJoystickX(unsigned int JoyId) const;
00110
00119 int GetJoystickY(unsigned int JoyId) const;
00120
00129 int GetJoystickZ(unsigned int JoyId) const;
00130
00131 private :
00132
00137 virtual void OnEvent(const Event& EventReceived);
00138
00140
00142 bool myKeys[Key::Count];
00143 bool myMouseButtons[3];
00144 bool myJoystickButtons[2][8];
00145 unsigned int myMouseX;
00146 unsigned int myMouseY;
00147 int myJoystickX[2];
00148 int myJoystickY[2];
00149 int myJoystickZ[2];
00150 };
00151
00152 }
00153
00154
00155 #endif // SFML_INPUT_HPP