public void HandleStateChange(object sender, PhysicalControlStateChangedEventArgs e) { var keySettings = _keySettingsReader.Read(); if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.NVISKey)) { _inputEvents.NightVisionModeToggled.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.AirspeedIndexIncreaseKey)) { _inputEvents.AirspeedIndexIncreasedByOne.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.AirspeedIndexDecreaseKey)) { _inputEvents.AirspeedIndexDecreasedByOne.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.EHSIHeadingDecreaseKey)) { _inputEvents.EHSILeftKnobDecreasedByOne.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.EHSIHeadingIncreaseKey)) { _inputEvents.EHSILeftKnobIncreasedByOne.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.EHSICourseDecreaseKey)) { _inputEvents.EHSIRightKnobDecreasedByOne.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.EHSICourseIncreaseKey)) { _inputEvents.EHSIRightKnobIncreasedByOne.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.EHSICourseDepressedKey)) { if (e.Control.ControlType == ControlType.Button && e.CurrentState == 0 && e.PreviousState == 1) { _inputEvents.EHSIRightKnobReleased.Handle(true); } else { _inputEvents.EHSIRightKnobDepressed.Handle(true); } } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.EHSIMenuButtonDepressedKey)) { _inputEvents.EHSIMenuButtonDepressed.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.ISISBrightButtonKey)) { _inputEvents.ISISBrightButtonDepressed.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.ISISStandardButtonKey)) { _inputEvents.ISISStandardButtonDepressed.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.AzimuthIndicatorBrightnessIncreaseKey)) { _inputEvents.AzimuthIndicatorBrightnessIncreased.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.AzimuthIndicatorBrightnessDecreaseKey)) { _inputEvents.AzimuthIndicatorBrightnessDecreased.Handle(true); } else if (_directInputEventHotkeyFilter.CheckIfMatches(e, keySettings.AccelerometerResetKey)) { _inputEvents.AccelerometerReset.Handle(true); } }
public void ProcessKeyDownEvent(KeyEventArgs e) { var keySettings = _keySettingsReader.Read(); var keys = _keyEventArgsAugmenter.UpdateKeyEventArgsWithExtendedKeyInfo(e.KeyData); if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.NVISKey, keys)) { _inputEvents.NightVisionModeToggled.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.AirspeedIndexIncreaseKey, keys)) { _inputEvents.AirspeedIndexIncreasedByOne.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.AirspeedIndexDecreaseKey, keys)) { _inputEvents.AirspeedIndexDecreasedByOne.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.EHSIHeadingDecreaseKey, keys)) { _inputEvents.EHSILeftKnobDecreasedByOne.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.EHSIHeadingIncreaseKey, keys)) { _inputEvents.EHSILeftKnobIncreasedByOne.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.EHSICourseDecreaseKey, keys)) { _inputEvents.EHSIRightKnobDecreasedByOne.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.EHSICourseIncreaseKey, keys)) { _inputEvents.EHSIRightKnobIncreasedByOne.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.EHSICourseDepressedKey, keys)) { _inputEvents.EHSIRightKnobDepressed.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.EHSIMenuButtonDepressedKey, keys)) { _inputEvents.EHSIMenuButtonDepressed.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.ISISBrightButtonKey, keys)) { _inputEvents.ISISBrightButtonDepressed.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.ISISStandardButtonKey, keys)) { _inputEvents.ISISStandardButtonDepressed.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.AzimuthIndicatorBrightnessIncreaseKey, keys)) { _inputEvents.AzimuthIndicatorBrightnessIncreased.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.AzimuthIndicatorBrightnessDecreaseKey, keys)) { _inputEvents.AzimuthIndicatorBrightnessDecreased.Handle(true); } else if (_keyInputEventHotkeyFilter.CheckIfMatches(keySettings.AccelerometerResetKey, keys)) { _inputEvents.AccelerometerReset.Handle(true); } }