Merged all the joystick fixes from trunk

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1343 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-01-11 09:04:59 +00:00
commit 7b83fbc544
13 changed files with 220 additions and 123 deletions

View file

@ -162,7 +162,7 @@ namespace Mouse
XButton1, ///< The first extra mouse button
XButton2, ///< The second extra mouse button
Count ///< Keep last -- the total number of mouse buttons
ButtonCount ///< Keep last -- the total number of mouse buttons
};
}
@ -183,7 +183,13 @@ namespace Joy
AxisV, ///< The V axis
AxisPOV, ///< The Point-Of-View axis (hat)
Count ///< Keep last -- the total number of joystick axis
AxisCount // Keep last -- total number of joystick axis
};
enum
{
Count = 4, ///< Total number of supported joysticks
ButtonCount = 32 ///< Total number of supported joystick buttons
};
}

View file

@ -128,15 +128,21 @@ private :
////////////////////////////////////////////////////////////
virtual void OnEvent(const Event& event);
////////////////////////////////////////////////////////////
/// Reset all the states
///
////////////////////////////////////////////////////////////
void ResetStates();
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
bool myKeys[Key::Count]; ///< Array containing the state of all keyboard keys
bool myMouseButtons[Mouse::Count]; ///< Array containing the state of all mouse buttons
bool myJoystickButtons[2][32]; ///< Array containing the state of all joysticks buttons
int myMouseX; ///< Mouse position on X
int myMouseY; ///< Mouse position on Y
float myJoystickAxis[2][Joy::Count]; ///< Joysticks position on each axis
bool myKeys[Key::Count]; ///< Array containing the state of all keyboard keys
bool myMouseButtons[Mouse::ButtonCount]; ///< Array containing the state of all mouse buttons
int myMouseX; ///< Mouse position on X
int myMouseY; ///< Mouse position on Y
bool myJoystickButtons[Joy::Count][Joy::ButtonCount]; ///< Array containing the state of all joysticks buttons
float myJoystickAxis[Joy::Count][Joy::AxisCount]; ///< Joysticks position on each axis
};
} // namespace sf