///////////////////////////////////////////////////////////////////////////// // Name: src/msw/joystick.cpp // Purpose: wxJoystick class // Author: Julian Smart // Modified by: // Created: 04/01/98 // RCS-ID: $Id: joystick.cpp 39021 2006-05-04 07:57:04Z ABX $ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #if wxUSE_JOYSTICK #include "wx/joystick.h" #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/window.h" #endif #include "wx/msw/private.h" #if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__) #include #endif // Why doesn't BC++ have joyGetPosEx? #if !defined(__WIN32__) || defined(__BORLANDC__) #define NO_JOYGETPOSEX #endif #include "wx/msw/registry.h" #include IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) // Attributes //////////////////////////////////////////////////////////////////////////// /** johan@linkdata.se 2002-08-20: Now returns only valid, functioning joysticks, counting from the first available and upwards. */ wxJoystick::wxJoystick(int joystick) { JOYINFO joyInfo; int i, maxsticks; maxsticks = joyGetNumDevs(); for( i=0; iGetHWND(), m_joystick, pollingFreq, changed); return (res == JOYERR_NOERROR); } bool wxJoystick::ReleaseCapture() { MMRESULT res = joyReleaseCapture(m_joystick); return (res == JOYERR_NOERROR); } #endif // wxUSE_JOYSTICK