GS_JOYSTICK_BUTTON SDLJoystick::GetFirstButtonDown(const unsigned int id) const { if (GetJoystickStatus(id) != GSJS_DETECTED) return GSB_NONE; for (unsigned int t = 0; t < m_joysticks[id].nButtons; t++) { if (IsJoystickButtonDown(id, (GS_JOYSTICK_BUTTON)t)) return (GS_JOYSTICK_BUTTON)t; } return GSB_NONE; }
//////////////////////////////////////////////////////////// /// Get the state of a joystick button //////////////////////////////////////////////////////////// sfBool sfInput_IsJoystickButtonDown(const sfInput* input, unsigned int joyId, unsigned int button) { CSFML_CALL_PTR_RETURN(input, IsJoystickButtonDown(joyId, button), sfFalse); }