Fix sending events for non-first wxJoystick buttons under MSW
Fix bug introduced by the (relatively) recent wxJoystick rewrite: using "!m_buttons" is wrong as it always returns 0 for any button(s) but the first one, we need bit-wise "~m_buttons" here instead. See https://github.com/wxWidgets/wxWidgets/pull/942 See #1142.
This commit is contained in:
parent
4cb1c8cab6
commit
7d5b467633
@ -116,7 +116,7 @@ void* wxJoystickThread::Entry()
|
||||
joyGetPos(m_joystick, &m_joyInfo);
|
||||
m_buttons = m_joyInfo.wButtons;
|
||||
UINT delta = m_buttons ^ m_lastJoyInfo.wButtons;
|
||||
UINT deltaUp = delta & !m_buttons;
|
||||
UINT deltaUp = delta & ~m_buttons;
|
||||
UINT deltaDown = delta & m_buttons;
|
||||
|
||||
// Use count trailing zeros to determine which button changed.
|
||||
|
Loading…
Reference in New Issue
Block a user