public override void FirstCheckState(ref Microsoft.DirectX.DirectInput.JoystickState controllerState) { int s = controllerState.GetPointOfView()[Index]; _state = -s; CheckState(ref controllerState); }
public override void CheckState(ref Microsoft.DirectX.DirectInput.JoystickState controllerState) { int s = controllerState.GetPointOfView()[Index]; if (_state != s) { _state = s; OnChangeValue(_state); } }
public override void CheckState(ref Microsoft.DirectX.DirectInput.JoystickState controllerState) { int s = controllerState.GetPointOfView()[Index]; if (s == _state && _state == -1) { return; } if (s == _state || s != -1) { if (s != _state) { _state = s; _repeatingState = false; OnChangeValue(_state); _repeating = true; _timer.Change(RepeatAfter, System.Threading.Timeout.Infinite); return; } if (!_repeating) { _state = s; _repeatingState = false; OnChangeValue(_state); _timer.Change(RepeatAfter, System.Threading.Timeout.Infinite); _repeating = true; return; } } else { if (_repeating || _state != -1) { _repeating = false; _timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); _state = s; OnChangeValue(_state); return; } } }