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:
Mick Phillips
2018-11-05 16:37:53 +00:00
committed by Vadim Zeitlin
parent cf980cf5e3
commit 291a880d0c
8 changed files with 57 additions and 25 deletions

View File

@@ -159,7 +159,7 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event)
#if wxUSE_STATUSBAR
wxString buf;
if (event.ButtonDown())
buf.Printf("Joystick (%ld, %ld) #%i Fire!", xpos, ypos, event.GetButtonChange());
buf.Printf("Joystick (%ld, %ld) #%i Fire!", xpos, ypos, event.GetButtonOrdinal());
else
buf.Printf("Joystick (%ld, %ld) ", xpos, ypos);