Merge branch 'joystick-fixes'

Harmonize joystick events between different platforms.

See https://github.com/wxWidgets/wxWidgets/pull/1017
This commit is contained in:
Vadim Zeitlin
2018-11-07 18:33:26 +01:00
11 changed files with 81 additions and 25 deletions

View File

@@ -15,6 +15,7 @@
#include "wx/cpp.h"
#include "wx/object.h"
#include "wx/clntdata.h"
#include "wx/math.h"
#if wxUSE_GUI
#include "wx/gdicmn.h"
@@ -2760,6 +2761,7 @@ public:
int GetZPosition() const { return m_zPosition; }
int GetButtonState() const { return m_buttonState; }
int GetButtonChange() const { return m_buttonChange; }
int GetButtonOrdinal() const { return wxCTZ(m_buttonChange); }
int GetJoystick() const { return m_joyStick; }
void SetJoystick(int stick) { m_joyStick = stick; }

View File

@@ -150,6 +150,9 @@ inline int wxRound(double x)
inline double wxDegToRad(double deg) { return (deg * M_PI) / 180.0; }
inline double wxRadToDeg(double rad) { return (rad * 180.0) / M_PI; }
// Count trailing zeros.
WXDLLIMPEXP_BASE unsigned int wxCTZ(wxUint32 x);
#endif /* __cplusplus */