422 references to Keyboard
Microsoft.CodeAnalysis.EditorFeatures (2)
InlineRename\UI\Adornment\RenameFlyout.xaml.cs (2)
177_viewModel.PreviewChangesFlag = Keyboard.Modifiers.HasFlag(ModifierKeys.Shift); 202if (Keyboard.Modifiers == ModifierKeys.Control)
Microsoft.VisualStudio.LanguageServices (1)
InheritanceMargin\MarginGlyph\InheritanceMarginGlyph.cs (1)
220Keyboard.Focus(visualElement);
PresentationCore (199)
MS\Internal\Automation\ElementProxy.cs (1)
342AutomationPeer focusedPeer = AutomationPeer.AutomationPeerFromInputElement(Keyboard.FocusedElement);
MS\Internal\Interop\TipTsfHelper.cs (1)
76if (Keyboard.FocusedElement == focusedObject)
MS\Internal\SynchronizedInputHelper.cs (5)
45return (re == Keyboard.KeyUpEvent || 46re == Keyboard.KeyDownEvent || 115return args.RoutedEvent == Keyboard.KeyDownEvent; 269e = new RoutedEvent[] {Keyboard.KeyUpEvent}; 272e = new RoutedEvent[] {Keyboard.KeyDownEvent, TextCompositionManager.TextInputEvent};
System\Windows\Automation\Peers\ContentElementAutomationPeer.cs (1)
183return Keyboard.IsFocusable(_owner);
System\Windows\Automation\Peers\UIElement3DAutomationPeer.cs (1)
286return Keyboard.IsFocusable(_owner);
System\Windows\Automation\Peers\UIElementAutomationPeer.cs (1)
330return Keyboard.IsFocusable(_owner);
System\Windows\ContentElement.cs (3)
265Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 468return (Keyboard.FocusedElement == this); 476if (Keyboard.Focus(this) == this)
System\Windows\Generated\ContentElement.cs (24)
1621public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 1628add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 1629remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 1640public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 1647add { AddHandler(Keyboard.KeyDownEvent, value, false); } 1648remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 1659public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 1666add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 1667remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 1678public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 1685add { AddHandler(Keyboard.KeyUpEvent, value, false); } 1686remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 1697public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 1704add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 1705remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 1716public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 1723add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 1724remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 1735public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 1742add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 1743remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 1754public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 1761add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 1762remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Generated\UIElement.cs (32)
767EventManager.RegisterClassHandler(type, Keyboard.PreviewKeyDownEvent, new KeyEventHandler(UIElement.OnPreviewKeyDownThunk), false); 768EventManager.RegisterClassHandler(type, Keyboard.KeyDownEvent, new KeyEventHandler(UIElement.OnKeyDownThunk), false); 769EventManager.RegisterClassHandler(type, Keyboard.PreviewKeyUpEvent, new KeyEventHandler(UIElement.OnPreviewKeyUpThunk), false); 770EventManager.RegisterClassHandler(type, Keyboard.KeyUpEvent, new KeyEventHandler(UIElement.OnKeyUpThunk), false); 771EventManager.RegisterClassHandler(type, Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnPreviewGotKeyboardFocusThunk), false); 772EventManager.RegisterClassHandler(type, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnGotKeyboardFocusThunk), false); 773EventManager.RegisterClassHandler(type, Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnPreviewLostKeyboardFocusThunk), false); 774EventManager.RegisterClassHandler(type, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnLostKeyboardFocusThunk), false); 3574public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 3581add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 3582remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 3593public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 3600add { AddHandler(Keyboard.KeyDownEvent, value, false); } 3601remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 3612public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 3619add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 3620remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 3631public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 3638add { AddHandler(Keyboard.KeyUpEvent, value, false); } 3639remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 3650public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 3657add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 3658remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 3669public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 3676add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 3677remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 3688public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 3695add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 3696remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 3707public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 3714add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 3715remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Generated\UIElement3D.cs (24)
1351public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 1358add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 1359remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 1370public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 1377add { AddHandler(Keyboard.KeyDownEvent, value, false); } 1378remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 1389public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 1396add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 1397remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 1408public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 1415add { AddHandler(Keyboard.KeyUpEvent, value, false); } 1416remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 1427public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 1434add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 1435remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 1446public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 1453add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 1454remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 1465public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 1472add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 1473remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 1484public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 1491add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 1492remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Input\AccessKeyManager.cs (2)
198if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 356(scope is PresentationSource) && (Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt)
System\Windows\Input\Command\CommandDevice.cs (5)
32return Keyboard.FocusedElement; 107else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent || 109e.StagingItem.Input.RoutedEvent == Keyboard.GotKeyboardFocusEvent || 110e.StagingItem.Input.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 283return Keyboard.FocusedElement;
System\Windows\Input\Command\KeyGesture.cs (1)
179return ( ( (int)Key == (int)keyEventArgs.RealKey ) && ( this.Modifiers == Keyboard.Modifiers ) );
System\Windows\Input\Command\MouseGesture.cs (1)
132return ( ( (int)this.MouseAction == (int)mouseAction ) && ( this.Modifiers == Keyboard.Modifiers ) );
System\Windows\Input\Command\RoutedCommand.cs (5)
81Execute(parameter, FilterInputElement(Keyboard.FocusedElement)); 92return CanExecuteImpl(parameter, FilterInputElement(Keyboard.FocusedElement), false, out unused); 127target = FilterInputElement(Keyboard.FocusedElement); 163target = FilterInputElement(Keyboard.FocusedElement); 365target = FilterInputElement(Keyboard.FocusedElement);
System\Windows\Input\DefaultTextStore.cs (2)
142_composition = new DefaultTextStoreTextComposition(InputManager.Current, Keyboard.FocusedElement, result, TextCompositionAutoComplete.On); 172_composition = new DefaultTextStoreTextComposition(InputManager.Current, Keyboard.FocusedElement, "", TextCompositionAutoComplete.Off);
System\Windows\Input\FocusManager.cs (3)
217DependencyObject oldFocus = Keyboard.FocusedElement as DependencyObject; 219DependencyObject newFocus = Keyboard.FocusedElement as DependencyObject; 229Keyboard.Focus(newFocusedElement);
System\Windows\Input\InputMethod.cs (8)
535IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 572hwnd = HwndFromInputElement(Keyboard.FocusedElement); 768IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 819hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1026IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1100IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1292if (inputElement == Keyboard.FocusedElement) 1326hwnd = HwndFromInputElement(Keyboard.FocusedElement);
System\Windows\Input\Keyboard.cs (20)
19public static readonly RoutedEvent PreviewKeyDownEvent = EventManager.RegisterRoutedEvent("PreviewKeyDown", RoutingStrategy.Tunnel, typeof(KeyEventHandler), typeof(Keyboard)); 44public static readonly RoutedEvent KeyDownEvent = EventManager.RegisterRoutedEvent("KeyDown", RoutingStrategy.Bubble, typeof(KeyEventHandler), typeof(Keyboard)); 69public static readonly RoutedEvent PreviewKeyUpEvent = EventManager.RegisterRoutedEvent("PreviewKeyUp", RoutingStrategy.Tunnel, typeof(KeyEventHandler), typeof(Keyboard)); 94public static readonly RoutedEvent KeyUpEvent = EventManager.RegisterRoutedEvent("KeyUp", RoutingStrategy.Bubble, typeof(KeyEventHandler), typeof(Keyboard)); 119public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = EventManager.RegisterRoutedEvent("PreviewGotKeyboardFocus", RoutingStrategy.Tunnel, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 144public static readonly RoutedEvent PreviewKeyboardInputProviderAcquireFocusEvent = EventManager.RegisterRoutedEvent("PreviewKeyboardInputProviderAcquireFocus", RoutingStrategy.Tunnel, typeof(KeyboardInputProviderAcquireFocusEventHandler), typeof(Keyboard)); 169public static readonly RoutedEvent KeyboardInputProviderAcquireFocusEvent = EventManager.RegisterRoutedEvent("KeyboardInputProviderAcquireFocus", RoutingStrategy.Bubble, typeof(KeyboardInputProviderAcquireFocusEventHandler), typeof(Keyboard)); 194public static readonly RoutedEvent GotKeyboardFocusEvent = EventManager.RegisterRoutedEvent("GotKeyboardFocus", RoutingStrategy.Bubble, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 219public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = EventManager.RegisterRoutedEvent("PreviewLostKeyboardFocus", RoutingStrategy.Tunnel, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 244public static readonly RoutedEvent LostKeyboardFocusEvent = EventManager.RegisterRoutedEvent("LostKeyboardFocus", RoutingStrategy.Bubble, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 273return Keyboard.PrimaryDevice.FocusedElement; 282Keyboard.PrimaryDevice.ClearFocus(); 293return Keyboard.PrimaryDevice.Focus(element); 303return Keyboard.PrimaryDevice.DefaultRestoreFocusMode; 308Keyboard.PrimaryDevice.DefaultRestoreFocusMode = value; 319return Keyboard.PrimaryDevice.Modifiers; 328return Keyboard.PrimaryDevice.IsKeyDown(key); 336return Keyboard.PrimaryDevice.IsKeyUp(key); 344return Keyboard.PrimaryDevice.IsKeyToggled(key); 352return Keyboard.PrimaryDevice.GetKeyStates(key);
System\Windows\Input\KeyboardDevice.cs (17)
143isValid = Keyboard.IsFocusable(focus); 276RoutedEvent = Keyboard.PreviewLostKeyboardFocusEvent, 295RoutedEvent = Keyboard.PreviewGotKeyboardFocusEvent, 311if (keyboardInputProvider != null && Keyboard.IsFocusable(newFocus)) 320RoutedEvent = Keyboard.PreviewKeyboardInputProviderAcquireFocusEvent, 332RoutedEvent = Keyboard.KeyboardInputProviderAcquireFocusEvent, 469RoutedEvent = Keyboard.LostKeyboardFocusEvent, 479RoutedEvent = Keyboard.GotKeyboardFocusEvent, 589if(Keyboard.IsFocusable(element)) 752if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 776else if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 791if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 838keyDown.RoutedEvent=Keyboard.KeyDownEvent; 846if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 892keyUp.RoutedEvent=Keyboard.KeyUpEvent; 924previewKeyDown.RoutedEvent=Keyboard.PreviewKeyDownEvent; 943previewKeyUp.RoutedEvent=Keyboard.PreviewKeyUpEvent;
System\Windows\Input\KeyEventArgs.cs (1)
31if (!Keyboard.IsValidKey(key))
System\Windows\Input\TextCompositionManager.cs (5)
426if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 467if (e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 486if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 747if (!Keyboard.IsKeyDown(Key.LeftAlt) && !Keyboard.IsKeyDown(Key.RightAlt))
System\Windows\Input\TextServicesManager.cs (12)
121if(e.StagingItem.Input.RoutedEvent != Keyboard.PreviewKeyDownEvent && 122e.StagingItem.Input.RoutedEvent != Keyboard.PreviewKeyUpEvent) 135DependencyObject element = Keyboard.FocusedElement as DependencyObject; 171DependencyObject element = Keyboard.FocusedElement as DependencyObject; 179if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent || 180e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 201else if(e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent || 202e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 240if (keyArgs.RoutedEvent == Keyboard.PreviewKeyDownEvent/*keyArgs.IsDown*/) 257if (Keyboard.IsKeyDown(Key.LeftAlt) || 258Keyboard.IsKeyDown(Key.RightAlt) || 259Keyboard.IsKeyDown(Key.F10))
System\Windows\InterOp\HwndKeyboardInputProvider.cs (5)
33Keyboard.Focus(null); // internally we will set the focus to the root. 346DependencyObject focusedDO = Keyboard.FocusedElement as DependencyObject; 485Keyboard.Focus(restoreFocusDO as IInputElement); 495restoreFocusDO = (DependencyObject)Keyboard.FocusedElement; 501Keyboard.ClearFocus();
System\Windows\InterOp\HwndSource.cs (12)
2066DependencyObject focusObject = Keyboard.FocusedElement as DependencyObject; 2324Keyboard.PrimaryDevice.ForceTarget = focusElement; 2329Keyboard.PrimaryDevice.ForceTarget = null; 2351keyPreviewEvent = Keyboard.PreviewKeyUpEvent; 2352keyEvent = Keyboard.KeyUpEvent; 2356keyPreviewEvent = Keyboard.PreviewKeyDownEvent; 2357keyEvent = Keyboard.KeyDownEvent; 2373focusElement = Keyboard.PrimaryDevice.FocusedElement; 2382Keyboard.PrimaryDevice.ForceTarget = focusSink as IInputElement; 2386KeyEventArgs tunnelArgs = new KeyEventArgs(Keyboard.PrimaryDevice, this, msg.time, key) 2398KeyEventArgs bubbleArgs = new KeyEventArgs(Keyboard.PrimaryDevice, this, msg.time, key) 2422Keyboard.PrimaryDevice.ForceTarget = null;
System\Windows\InterOp\HwndSourceParameters.cs (1)
259get { return _restoreFocusMode ?? Keyboard.DefaultRestoreFocusMode; }
System\Windows\UIElement.cs (3)
2370Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 2579return (Keyboard.FocusedElement == this); 2587if (Keyboard.Focus(this) == this)
System\Windows\UIElement3D.cs (3)
349Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 558return (Keyboard.FocusedElement == this); 566if (Keyboard.Focus(this) == this)
PresentationFramework (190)
MS\Internal\Documents\DocumentGrid.cs (2)
1254bool altKeyDown = Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt);
MS\Internal\Documents\DocumentViewerHelper.cs (1)
339DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\Button.cs (3)
87b.UpdateIsDefaulted(Keyboard.FocusedElement); 105b.UpdateIsDefaulted(Keyboard.FocusedElement); 189UpdateIsDefaulted(Keyboard.FocusedElement);
System\Windows\Controls\CalendarKeyboardHelper.cs (2)
12ctrl = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 13shift = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift;
System\Windows\Controls\ComboBox.cs (10)
1126DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject; 1346NavigateByLine(HighlightedInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1366NavigateByLine(HighlightedInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1405NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1420NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1435NavigateByLine(HighlightedInfo, FocusNavigationDirection.Right, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1458NavigateByLine(HighlightedInfo, FocusNavigationDirection.Left, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1479NavigateByPage(HighlightedInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1487NavigateByPage(HighlightedInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1493if (Keyboard.Modifiers == ModifierKeys.Control)
System\Windows\Controls\ContextMenu.cs (4)
424NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 433NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 598if (Keyboard.FocusedElement != null) 600_weakRefToPreviousFocus = new WeakReference<IInputElement>(Keyboard.FocusedElement);
System\Windows\Controls\DataGrid.cs (21)
1357(Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift; 5292(_isDraggingSelection || ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)); 5304return (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 5540UIElement startElement = Keyboard.FocusedElement as UIElement; 5541ContentElement startContentElement = (startElement == null) ? Keyboard.FocusedElement as ContentElement : null; 5554Keyboard.Focus(nextFocusTarget as IInputElement); 5668Keyboard.Focus(nextFocusTarget as IInputElement); 5714Keyboard.Focus(nextFocusTarget as IInputElement); 5748Keyboard.Focus(nextFocusTarget as IInputElement); 5783Keyboard.Focus(nextFocusTarget as IInputElement); 5830FrameworkElement startingElement = Keyboard.FocusedElement as FrameworkElement; 5837new ItemNavigateArgs(e.KeyboardDevice, Keyboard.Modifiers), 5874UIElement startElement = Keyboard.FocusedElement as UIElement; 5875ContentElement startContentElement = (startElement == null) ? Keyboard.FocusedElement as ContentElement : null; 5888if (wasEditing && previous && Keyboard.FocusedElement == currentCellContainer) 5980DataGridCell newCell = Keyboard.FocusedElement as DataGridCell; 6131startingElement = Keyboard.FocusedElement as FrameworkElement; 6151PrepareToNavigateByPage(startingInfo, startingElement, direction, new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), out targetElement); 7076(Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift); 7121if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
System\Windows\Controls\DataGridCell.cs (2)
887bool isCtrlKeyPressed = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 955ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask;
System\Windows\Controls\DataGridCheckBoxColumn.cs (1)
213keyArgs.RoutedEvent == Keyboard.KeyDownEvent &&
System\Windows\Controls\DataGridComboBoxColumn.cs (1)
597if ((keyArgs != null) && keyArgs.RoutedEvent == Keyboard.KeyDownEvent && ((keyArgs.KeyStates & KeyStates.Down) == KeyStates.Down))
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
283Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\DataGridTextColumn.cs (1)
268Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\DatePicker.cs (1)
1159if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
System\Windows\Controls\DocumentViewer.cs (2)
1213if (Keyboard.IsKeyDown(Key.LeftCtrl) || 1214Keyboard.IsKeyDown(Key.RightCtrl))
System\Windows\Controls\FlowDocumentReader.cs (3)
58EventManager.RegisterClassHandler(typeof(FlowDocumentReader), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 921focusedElement = Keyboard.FocusedElement as DependencyObject; 978DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\FlowDocumentScrollViewer.cs (2)
66EventManager.RegisterClassHandler(typeof(FlowDocumentScrollViewer), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 696if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
System\Windows\Controls\ItemsControl.cs (8)
56EventManager.RegisterClassHandler(typeof(ItemsControl), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus)); 1832DependencyObject startingElement = Keyboard.FocusedElement as DependencyObject; 2182return NavigateByPage(FocusedInfo, Keyboard.FocusedElement as FrameworkElement, direction, itemNavigateArgs); 2574if (container == null || Keyboard.IsFocusable(container)) 3340NavigateByLine(startingInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3345NavigateByLine(startingInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3360NavigateByLine(startingInfo, direction, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3370NavigateByLine(startingInfo, direction, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers));
System\Windows\Controls\ListBox.cs (25)
73EventManager.RegisterClassHandler(typeof(ListBox), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 314if (((Keyboard.Modifiers) == (ModifierKeys.Control)) && (SelectionMode == SelectionMode.Extended)) 327if (((Keyboard.Modifiers) == (ModifierKeys.Control)) && (SelectionMode == SelectionMode.Extended)) 370new ItemNavigateArgs(e.Device, Keyboard.Modifiers))) 384NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 388NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 404if ((Keyboard.Modifiers & (ModifierKeys.Control|ModifierKeys.Alt)) == ModifierKeys.Alt) 412if (IsTextSearchEnabled && Keyboard.Modifiers == ModifierKeys.None) 429if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 445if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == ModifierKeys.Control) 450else if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == ModifierKeys.Shift) 455else if ((Keyboard.Modifiers & ModifierKeys.Shift) == 0) 475NavigateByPage(FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 479NavigateByPage(FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 495ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask; 712else if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 729if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == (ModifierKeys.Control | ModifierKeys.Shift)) 733else if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 737else if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 751if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == 0) 768NavigateToItem(ItemInfoFromContainer(listItem), new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 912if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) 923if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 925bool clearCurrentSelection = (Keyboard.Modifiers & ModifierKeys.Control) == 0; 928else if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
System\Windows\Controls\Menu.cs (2)
320if (!(Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt)))
System\Windows\Controls\MenuItem.cs (10)
1894if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 1896NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1900NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1943NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1953NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 2326NavigateToStart(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers)); 2361object previousFocus = Keyboard.FocusedElement; 2362parent.NavigateByLine(parent.FocusedInfo, KeyboardNavigation.KeyToTraversalDirection(key), new ItemNavigateArgs(Keyboard.PrimaryDevice, modifiers)); 2363object currentFocus = Keyboard.FocusedElement;
System\Windows\Controls\PopupControlService.cs (7)
105else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 109else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 121else if (e.StagingItem.Input.RoutedEvent == Keyboard.GotKeyboardFocusEvent) 125else if (e.StagingItem.Input.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 218ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask; 251(Keyboard.Modifiers == ModifierKeys.None) && (CurrentToolTip?.FromKeyboard ?? false)) 265DependencyObject owner = FindToolTipOwner(Keyboard.FocusedElement, ToolTipService.TriggerAction.KeyboardShortcut);
System\Windows\Controls\Primitives\ButtonBase.cs (3)
528Keyboard.Focus(null); 603if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Alt)) != ModifierKeys.Alt) 667if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Alt)) != ModifierKeys.Alt)
System\Windows\Controls\Primitives\MenuBase.cs (4)
56EventManager.RegisterClassHandler(typeof(MenuBase), Keyboard.PreviewKeyboardInputProviderAcquireFocusEvent, new KeyboardInputProviderAcquireFocusEventHandler(OnPreviewKeyboardInputProviderAcquireFocus), true); 57EventManager.RegisterClassHandler(typeof(MenuBase), Keyboard.KeyboardInputProviderAcquireFocusEvent, new KeyboardInputProviderAcquireFocusEventHandler(OnKeyboardInputProviderAcquireFocus), true); 662 Keyboard.Focus(null); 671Keyboard.ClearFocus();
System\Windows\Controls\Primitives\ScrollBar.cs (1)
138((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift))
System\Windows\Controls\Primitives\Selector.cs (1)
1313DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\Primitives\TextBoxBase.cs (1)
2095if (Keyboard.FocusedElement == textBox)
System\Windows\Controls\ScrollViewer.cs (1)
945DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\SinglePageViewer.cs (2)
62EventManager.RegisterClassHandler(typeof(FlowDocumentPageViewer), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 422if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
System\Windows\Controls\Slider.cs (1)
173if (keyEventArgs != null && slider != null && Keyboard.Modifiers == ModifierKeys.None)
System\Windows\Controls\StickyNote.cs (2)
532ContextMenu menu = Keyboard.FocusedElement as ContextMenu; 1356Keyboard.Focus(null);
System\Windows\Controls\TabItem.cs (5)
294if (e.OldFocus != Keyboard.FocusedElement) 327if (e.OldFocus != Keyboard.FocusedElement) 353if (Keyboard.FocusedElement is DependencyObject focusedElement) 356if (thisFocusScope != null && Keyboard.FocusedElement is DependencyObject currentFocus) 473TabItem currentFocus = Keyboard.FocusedElement as TabItem;
System\Windows\Controls\TextSearch.cs (1)
225_attachedTo.NavigateToItem(matchedItem, matchedItemIndex, new ItemsControl.ItemNavigateArgs(Keyboard.PrimaryDevice, ModifierKeys.None));
System\Windows\Controls\ToolBar.cs (2)
257Keyboard.Focus(null); 656Keyboard.Focus(null);
System\Windows\Controls\TreeView.cs (9)
597return ((Keyboard.Modifiers & ModifierKeys.Control) == (ModifierKeys.Control)); 605return ((Keyboard.Modifiers & ModifierKeys.Shift) == (ModifierKeys.Shift)); 612return NavigateToStartInternal(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), true /*shouldFocus*/, out container); 619return NavigateToEndInternal(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), true /*shouldFocus*/, out container); 699IInputElement originalFocusedElement = Keyboard.FocusedElement; 712new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 752DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\TreeViewItem.cs (4)
645return ((Keyboard.Modifiers & ModifierKeys.Control) == (ModifierKeys.Control)); 673IInputElement originalFocus = Keyboard.FocusedElement; 688new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 702DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Documents\FixedPage.cs (2)
95if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
System\Windows\Documents\Hyperlink.cs (2)
492if (IsEnabled && (!IsEditable || ((Keyboard.Modifiers & ModifierKeys.Control) != 0))) 807if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
System\windows\Documents\TextEditor.cs (2)
383EventManager.RegisterClassHandler(controlType, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 384EventManager.RegisterClassHandler(controlType, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus));
System\windows\Documents\TextEditorMouse.cs (4)
100else if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0 && This.Selection.IsEmpty) 107else if (clickCount == 3 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0) 182if (This.UiScope != Keyboard.FocusedElement) 633return This.UiScope == Keyboard.FocusedElement &&
System\windows\Documents\TextEditorTyping.cs (3)
54EventManager.RegisterClassHandler(controlType, Keyboard.PreviewKeyDownEvent, new KeyEventHandler(OnPreviewKeyDown)); 55EventManager.RegisterClassHandler(controlType, Keyboard.KeyDownEvent, new KeyEventHandler(OnKeyDown)); 56EventManager.RegisterClassHandler(controlType, Keyboard.KeyUpEvent, new KeyEventHandler(OnKeyUp));
System\windows\Documents\TextSelection.cs (3)
779if ((Keyboard.Modifiers & ModifierKeys.Shift) != 0) 889bool disableWordExpansion = !_textEditor.AutoWordSelection || ((Keyboard.Modifiers & ModifierKeys.Shift) != 0 && (Keyboard.Modifiers & ModifierKeys.Control) != 0);
System\Windows\Documents\TextStore.cs (3)
1191if (Keyboard.FocusedElement == UiScope) 2970if ((Keyboard.Modifiers & ModifierKeys.Shift) != 0) 2974if ((Keyboard.Modifiers & ModifierKeys.Control) != 0)
System\Windows\FrameworkContentElement.cs (2)
91EventManager.RegisterClassHandler(typeof(FrameworkContentElement), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 92EventManager.RegisterClassHandler(typeof(FrameworkContentElement), Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus));
System\Windows\FrameworkElement.cs (7)
2370EventManager.RegisterClassHandler(_typeofThis, Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnPreviewGotKeyboardFocus)); 2371EventManager.RegisterClassHandler(_typeofThis, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 2372EventManager.RegisterClassHandler(_typeofThis, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus)); 5330if (activeElement != null && activeElement != sender && Keyboard.IsFocusable(activeElement as DependencyObject)) 5332IInputElement oldFocus = Keyboard.FocusedElement; 5335if (Keyboard.FocusedElement == activeElement || Keyboard.FocusedElement != oldFocus)
System\Windows\Input\KeyboardNavigation.cs (13)
829Current.ShowFocusVisual(Keyboard.FocusedElement as DependencyObject); 965return Navigate(currentElement, request, Keyboard.Modifiers); 1179if(inputEventArgs.RoutedEvent != Keyboard.KeyDownEvent) 2724sourceUIElement.RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2728sourceContentElement?.RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2738targetContentElement?.AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus), true); 2749targetUIElement.AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus), true); 2777((UIElement)sender).RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2779((ContentElement)sender).RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 3150if (inputEventArgs.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 3161else if (inputEventArgs.RoutedEvent == Keyboard.KeyDownEvent) 3173if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Windows)) == ModifierKeys.None) 3192else if (inputEventArgs.RoutedEvent == Keyboard.KeyUpEvent)
System\Windows\Interop\ActiveXHost.cs (2)
73EventManager.RegisterClassHandler(typeof(ActiveXHost), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus)); 74EventManager.RegisterClassHandler(typeof(ActiveXHost), Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostFocus));
System\Windows\Navigation\NavigationService.cs (1)
808Keyboard.PrimaryDevice.Focus(null);
System.Windows.Controls.Ribbon (30)
Microsoft\Windows\Controls\KeyTipService.cs (8)
633(Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift && 634(Keyboard.Modifiers & ModifierKeys.Control) != ModifierKeys.Control); 684if (routedEvent == Keyboard.PreviewKeyUpEvent) 702else if (routedEvent == Keyboard.PreviewKeyDownEvent) 715if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 945object oldFocusedElement = Keyboard.FocusedElement; 958object newFocusedElement = Keyboard.FocusedElement; 1268return ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt);
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (4)
1965RibbonGroup ribbonGroup = TreeHelper.FindVisualAncestor<RibbonGroup>(Keyboard.FocusedElement as DependencyObject); 2039RibbonControl ribbonControl = TreeHelper.FindVisualAncestor<RibbonControl>(Keyboard.FocusedElement as DependencyObject); 2071!TreeHelper.IsVisualAncestorOf(targetControl, Keyboard.FocusedElement as DependencyObject)) 2210DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (5)
1039bool shiftPressed = ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift); 1192DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject; 1440RibbonGalleryItem focusedGalleryItem = Keyboard.FocusedElement as RibbonGalleryItem; 1600_firstGallery.RemoveHandler(Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGalleryGotKeyboardFocus)); 1613_firstGallery.AddHandler(Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGalleryGotKeyboardFocus), true);
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (1)
2666DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonGalleryItem.cs (2)
416if ((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt) 449if ((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (3)
480UIElement uie = Keyboard.FocusedElement as UIElement; 485ContentElement ce = Keyboard.FocusedElement as ContentElement; 1208Keyboard.Focus(null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
803DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject; 856if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
905if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
369DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonTabHeader.cs (2)
526if (!((bool)e.NewValue) && Keyboard.FocusedElement == d) 528Keyboard.Focus(null);
Microsoft\Windows\Controls\Ribbon\RibbonToolTipService.cs (1)
34if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent)