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
00110 float GetJoystickAxis(unsigned int JoyId, Joy::Axis Axis) const;
00111
00112 private :
00113
00118 virtual void OnEvent(const Event& EventReceived);
00119
00121
00123 bool myKeys[Key::Count];
00124 bool myMouseButtons[Mouse::Count];
00125 bool myJoystickButtons[2][16];
00126 unsigned int myMouseX;
00127 unsigned int myMouseY;
00128 float myJoystickAxis[2][Joy::Count];
00129 };
00130
00131 }
00132
00133
00134 #endif // SFML_INPUT_HPP