///////////////////////////////////////////////////////////////////////////// // Name: joystick.cpp // Purpose: wxJoystick class // Author: Julian Smart // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "joystick.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #include "wx/string.h" #include "wx/window.h" #include "wx/msw/private.h" #if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__) #include #endif #if !defined(__WIN32__) && !defined(_MMRESULT_) typedef UINT MMRESULT; #endif #ifdef __GNUWIN32_OLD__ #include "wx/msw/gnuwin32/extra.h" #endif // Why doesn't BC++ have joyGetPosEx? #if !defined(__WIN32__) || defined(__BORLANDC__) #define NO_JOYGETPOSEX #endif #include "wx/window.h" #include "wx/msw/joystick.h" 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); }