protected override void OnPreviewKeyDown(KeyEventArgs e) { //Trace.WriteLine(string.Format("Preview KeyDown, queueing KeyInfo: {0}", e.Key)); _inputBuffer.Enqueue(e.ToKeyInfo()); //if ((Keyboard.Modifiers & ModifierKeys.None) == 0 && !_popup.IsOpen) // _commandContainer.Child.Focus(); // Notice this is "whichever" is active ;) base.OnPreviewKeyDown(e); }
protected override void OnPreviewKeyUp(KeyEventArgs e) { //Trace.WriteLine(string.Format("Preview KeyUp, queueing KeyInfo: {0} ({1})", e.Key, e.Handled)); // NOTE: if it's empty, it must have been CLEARed during the KeyDown, // so we don't want to count the KeyUp either if (_inputBuffer.Count > 0) { _inputBuffer.Enqueue(e.ToKeyInfo()); _gotInputKey.Set(); } base.OnPreviewKeyUp(e); }