/// <summary> /// </summary> /// <param name="e"></param> protected override void OnKeyDown(KeyEventArgs e) { MSG msg; if (_fTrusted.Value) { msg = ComponentDispatcher.UnsecureCurrentKeyboardMessage; } else { msg = ComponentDispatcher.CurrentKeyboardMessage; } ModifierKeys modifiers = HwndKeyboardInputProvider.GetSystemModifierKeys(); bool handled = ((IKeyboardInputSink)this).TranslateAccelerator(ref msg, modifiers); if (handled) { e.Handled = handled; } base.OnKeyDown(e); }
protected override void OnKeyUp(KeyEventArgs e) { MSG msg; if (this._fTrusted.Value) { msg = ComponentDispatcher.UnsecureCurrentKeyboardMessage; } else { msg = ComponentDispatcher.CurrentKeyboardMessage; } ModifierKeys systemModifierKeys = HwndKeyboardInputProvider.GetSystemModifierKeys(); bool flag = ((IKeyboardInputSink)this).TranslateAccelerator(ref msg, systemModifierKeys); if (flag) { e.Handled = flag; } base.OnKeyUp(e); }