Add missing joystick methods

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2014-01-23 00:17:04 +00:00
parent 1ef5afb429
commit c2bf436db3

View File

@@ -187,6 +187,14 @@ wxPoint wxJoystick::GetPosition() const
if (m_thread) pos = m_thread->m_lastposition;
return pos;
}
int wxJoystick::GetPosition(unsigned int axis) const
{
wxCHECK_MSG(axis >=0 && axis < GetNumberAxes(), 0, "Invalid joystick axis");
if (m_thread)
return m_thread->m_axe[axis];
return 0;
}
int wxJoystick::GetZPosition() const
{
if (m_thread)
@@ -225,6 +233,14 @@ int wxJoystick::GetButtonState() const
return 0;
}
bool wxJoystick::GetButtonState(unsigned int id) const
{
if (id > sizeof(int) * 8)
return false;
return (GetButtonState() & (1 << id)) != 0;
}
//---------------------------------------------------------------------------
// wxJoystick::IsOk
//