Synchronize joystick events between all ports
Generate wxJoystickEvent with the same fields under all platforms by making the Linux and macOS versions follow MSW convention of using "1 << N" for the changed button. Add GetButtonOrdinal() accessor which can be used to retrieve just N. Closes #18233.
This commit is contained in:
committed by
Vadim Zeitlin
parent
cf980cf5e3
commit
291a880d0c
@@ -181,12 +181,12 @@ void* wxJoystickThread::Entry()
|
||||
if (j_evt.value)
|
||||
{
|
||||
m_buttons |= (1 << j_evt.number);
|
||||
SendEvent(wxEVT_JOY_BUTTON_DOWN, j_evt.time, j_evt.number);
|
||||
SendEvent(wxEVT_JOY_BUTTON_DOWN, j_evt.time, 1 << j_evt.number);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_buttons &= ~(1 << j_evt.number);
|
||||
SendEvent(wxEVT_JOY_BUTTON_UP, j_evt.time, j_evt.number);
|
||||
SendEvent(wxEVT_JOY_BUTTON_UP, j_evt.time, 1 << j_evt.number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user