mirror of
https://github.com/SCToolsfactory/SCJMapper-V2.git
synced 2024-11-16 12:13:09 +00:00
[joystickcls] GetLastChange button diffs
Ensure that when generating changes between the last joystick state and the current one that we actually compare button states. This causes another bug with the joystick axis frequently becoming selected, which will be fixed in a further commit
This commit is contained in:
parent
0c1833451b
commit
c87eed91ec
@ -219,8 +219,10 @@ public String GetLastChange( )
|
|||||||
if ( pov[3] >= 0 ) if ( pov[3] != ppov[3] ) m_lastItem = "hat4_" + HatDir( pov[0] );
|
if ( pov[3] >= 0 ) if ( pov[3] != ppov[3] ) m_lastItem = "hat4_" + HatDir( pov[0] );
|
||||||
|
|
||||||
bool[] buttons = m_state.Buttons;
|
bool[] buttons = m_state.Buttons;
|
||||||
|
bool[] prevButtons = m_prevState.Buttons;
|
||||||
for ( int bi=0; bi < buttons.Length; bi++ ) {
|
for ( int bi=0; bi < buttons.Length; bi++ ) {
|
||||||
if ( buttons[bi] ) m_lastItem = "button" + ( bi + 1 ).ToString( );
|
if ( buttons[bi] && buttons[bi] != prevButtons[bi])
|
||||||
|
m_lastItem = "button" + ( bi + 1 ).ToString( );
|
||||||
}
|
}
|
||||||
return m_lastItem;
|
return m_lastItem;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user