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
00042 class SFML_API sfInput : public sfWindowListener, sfNonCopyable
00043 {
00044 public :
00045
00050 sfInput();
00051
00060 bool IsKeyDown(sfKey::Code Key) const;
00061
00070 bool IsMouseButtonDown(sfMouse::Button Button) const;
00071
00081 bool IsJoystickButtonDown(unsigned int JoyId, unsigned int Button) const;
00082
00089 unsigned int GetMouseX() const;
00090
00097 unsigned int GetMouseY() const;
00098
00107 int GetJoystickX(unsigned int JoyId) const;
00108
00117 int GetJoystickY(unsigned int JoyId) const;
00118
00127 int GetJoystickZ(unsigned int JoyId) const;
00128
00129 private :
00130
00135 virtual void OnEvent(const sfEvent& Event);
00136
00138
00140 bool myKeys[sfKey::Count];
00141 bool myMouseButtons[3];
00142 bool myJoystickButtons[2][8];
00143 unsigned int myMouseX;
00144 unsigned int myMouseY;
00145 int myJoystickX[2];
00146 int myJoystickY[2];
00147 int myJoystickZ[2];
00148 };
00149
00150
00151 #endif // SFML_INPUT_HPP