void activate() {
Controller cont = Controllers.getEventSource();
int index = Controllers.getEventControlIndex();
if( Controllers.isEventAxis() ) {
float joyVal = cont.getAxisValue(index);
ControlBinding bindPos = axisBinds.get( Pair.of(index,true ) );
ControlBinding bindNeg = axisBinds.get( Pair.of(index,false) );
if( bindPos == bindNeg ) {
if( bindPos != null)
bindPos.setValue( joyVal );
} else {
if( joyVal > 0 ) {
if( bindNeg != null )
bindNeg.setValue( 0 );
if( bindPos != null )
bindPos.setValue( joyVal );
} else {
if( bindPos != null )
bindPos.setValue( 0 );
if( bindNeg != null )
bindNeg.setValue( -joyVal );
}
}
} else if( Controllers.isEventButton() ) {
ControlBinding bind = buttonBinds.get(index);
if( bind != null ) {
bind.setState( cont.isButtonPressed(index));
}
} else if( Controllers.isEventPovX()) {
if( cont.getPovX() > 0) {
if( povXBindPos != null)
povXBindPos.setState(true);