422 references to Keyboard
Microsoft.CodeAnalysis.EditorFeatures.Wpf (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)
343AutomationPeer focusedPeer = AutomationPeer.AutomationPeerFromInputElement(Keyboard.FocusedElement);
MS\Internal\Interop\TipTsfHelper.cs (1)
77if (Keyboard.FocusedElement == focusedObject)
MS\Internal\SynchronizedInputHelper.cs (5)
46return (re == Keyboard.KeyUpEvent || 47re == Keyboard.KeyDownEvent || 116return args.RoutedEvent == Keyboard.KeyDownEvent; 270e = new RoutedEvent[] {Keyboard.KeyUpEvent}; 273e = new RoutedEvent[] {Keyboard.KeyDownEvent, TextCompositionManager.TextInputEvent};
System\Windows\Automation\Peers\ContentElementAutomationPeer.cs (1)
184return Keyboard.IsFocusable(_owner);
System\Windows\Automation\Peers\UIElement3DAutomationPeer.cs (1)
287return Keyboard.IsFocusable(_owner);
System\Windows\Automation\Peers\UIElementAutomationPeer.cs (1)
334return Keyboard.IsFocusable(_owner);
System\Windows\ContentElement.cs (3)
266Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 469return (Keyboard.FocusedElement == this); 477if (Keyboard.Focus(this) == this)
System\Windows\Generated\ContentElement.cs (24)
1622public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 1629add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 1630remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 1641public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 1648add { AddHandler(Keyboard.KeyDownEvent, value, false); } 1649remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 1660public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 1667add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 1668remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 1679public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 1686add { AddHandler(Keyboard.KeyUpEvent, value, false); } 1687remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 1698public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 1705add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 1706remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 1717public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 1724add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 1725remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 1736public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 1743add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 1744remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 1755public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 1762add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 1763remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Generated\UIElement.cs (32)
768EventManager.RegisterClassHandler(type, Keyboard.PreviewKeyDownEvent, new KeyEventHandler(UIElement.OnPreviewKeyDownThunk), false); 769EventManager.RegisterClassHandler(type, Keyboard.KeyDownEvent, new KeyEventHandler(UIElement.OnKeyDownThunk), false); 770EventManager.RegisterClassHandler(type, Keyboard.PreviewKeyUpEvent, new KeyEventHandler(UIElement.OnPreviewKeyUpThunk), false); 771EventManager.RegisterClassHandler(type, Keyboard.KeyUpEvent, new KeyEventHandler(UIElement.OnKeyUpThunk), false); 772EventManager.RegisterClassHandler(type, Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnPreviewGotKeyboardFocusThunk), false); 773EventManager.RegisterClassHandler(type, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnGotKeyboardFocusThunk), false); 774EventManager.RegisterClassHandler(type, Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnPreviewLostKeyboardFocusThunk), false); 775EventManager.RegisterClassHandler(type, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnLostKeyboardFocusThunk), false); 3575public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 3582add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 3583remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 3594public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 3601add { AddHandler(Keyboard.KeyDownEvent, value, false); } 3602remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 3613public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 3620add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 3621remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 3632public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 3639add { AddHandler(Keyboard.KeyUpEvent, value, false); } 3640remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 3651public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 3658add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 3659remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 3670public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 3677add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 3678remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 3689public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 3696add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 3697remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 3708public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 3715add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 3716remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Generated\UIElement3D.cs (24)
1352public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 1359add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 1360remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 1371public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 1378add { AddHandler(Keyboard.KeyDownEvent, value, false); } 1379remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 1390public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 1397add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 1398remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 1409public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 1416add { AddHandler(Keyboard.KeyUpEvent, value, false); } 1417remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 1428public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 1435add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 1436remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 1447public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 1454add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 1455remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 1466public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 1473add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 1474remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 1485public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 1492add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 1493remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Input\AccessKeyManager.cs (2)
199if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 357(scope is PresentationSource) && (Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt)
System\Windows\Input\Command\CommandDevice.cs (5)
33return Keyboard.FocusedElement; 108else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent || 110e.StagingItem.Input.RoutedEvent == Keyboard.GotKeyboardFocusEvent || 111e.StagingItem.Input.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 284return Keyboard.FocusedElement;
System\Windows\Input\Command\KeyGesture.cs (1)
180return ( ( (int)Key == (int)keyEventArgs.RealKey ) && ( this.Modifiers == Keyboard.Modifiers ) );
System\Windows\Input\Command\MouseGesture.cs (1)
133return ( ( (int)this.MouseAction == (int)mouseAction ) && ( this.Modifiers == Keyboard.Modifiers ) );
System\Windows\Input\Command\RoutedCommand.cs (5)
82Execute(parameter, FilterInputElement(Keyboard.FocusedElement)); 93return CanExecuteImpl(parameter, FilterInputElement(Keyboard.FocusedElement), false, out unused); 128target = FilterInputElement(Keyboard.FocusedElement); 164target = FilterInputElement(Keyboard.FocusedElement); 366target = FilterInputElement(Keyboard.FocusedElement);
System\Windows\Input\DefaultTextStore.cs (2)
143_composition = new DefaultTextStoreTextComposition(InputManager.Current, Keyboard.FocusedElement, result, TextCompositionAutoComplete.On); 173_composition = new DefaultTextStoreTextComposition(InputManager.Current, Keyboard.FocusedElement, "", TextCompositionAutoComplete.Off);
System\Windows\Input\FocusManager.cs (3)
218DependencyObject oldFocus = Keyboard.FocusedElement as DependencyObject; 220DependencyObject newFocus = Keyboard.FocusedElement as DependencyObject; 230Keyboard.Focus(newFocusedElement);
System\Windows\Input\InputMethod.cs (8)
536IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 573hwnd = HwndFromInputElement(Keyboard.FocusedElement); 769IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 820hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1027IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1101IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1293if (inputElement == Keyboard.FocusedElement) 1327hwnd = HwndFromInputElement(Keyboard.FocusedElement);
System\Windows\Input\Keyboard.cs (20)
20public static readonly RoutedEvent PreviewKeyDownEvent = EventManager.RegisterRoutedEvent("PreviewKeyDown", RoutingStrategy.Tunnel, typeof(KeyEventHandler), typeof(Keyboard)); 45public static readonly RoutedEvent KeyDownEvent = EventManager.RegisterRoutedEvent("KeyDown", RoutingStrategy.Bubble, typeof(KeyEventHandler), typeof(Keyboard)); 70public static readonly RoutedEvent PreviewKeyUpEvent = EventManager.RegisterRoutedEvent("PreviewKeyUp", RoutingStrategy.Tunnel, typeof(KeyEventHandler), typeof(Keyboard)); 95public static readonly RoutedEvent KeyUpEvent = EventManager.RegisterRoutedEvent("KeyUp", RoutingStrategy.Bubble, typeof(KeyEventHandler), typeof(Keyboard)); 120public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = EventManager.RegisterRoutedEvent("PreviewGotKeyboardFocus", RoutingStrategy.Tunnel, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 145public static readonly RoutedEvent PreviewKeyboardInputProviderAcquireFocusEvent = EventManager.RegisterRoutedEvent("PreviewKeyboardInputProviderAcquireFocus", RoutingStrategy.Tunnel, typeof(KeyboardInputProviderAcquireFocusEventHandler), typeof(Keyboard)); 170public static readonly RoutedEvent KeyboardInputProviderAcquireFocusEvent = EventManager.RegisterRoutedEvent("KeyboardInputProviderAcquireFocus", RoutingStrategy.Bubble, typeof(KeyboardInputProviderAcquireFocusEventHandler), typeof(Keyboard)); 195public static readonly RoutedEvent GotKeyboardFocusEvent = EventManager.RegisterRoutedEvent("GotKeyboardFocus", RoutingStrategy.Bubble, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 220public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = EventManager.RegisterRoutedEvent("PreviewLostKeyboardFocus", RoutingStrategy.Tunnel, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 245public static readonly RoutedEvent LostKeyboardFocusEvent = EventManager.RegisterRoutedEvent("LostKeyboardFocus", RoutingStrategy.Bubble, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 274return Keyboard.PrimaryDevice.FocusedElement; 283Keyboard.PrimaryDevice.ClearFocus(); 294return Keyboard.PrimaryDevice.Focus(element); 304return Keyboard.PrimaryDevice.DefaultRestoreFocusMode; 309Keyboard.PrimaryDevice.DefaultRestoreFocusMode = value; 320return Keyboard.PrimaryDevice.Modifiers; 329return Keyboard.PrimaryDevice.IsKeyDown(key); 337return Keyboard.PrimaryDevice.IsKeyUp(key); 345return Keyboard.PrimaryDevice.IsKeyToggled(key); 353return Keyboard.PrimaryDevice.GetKeyStates(key);
System\Windows\Input\KeyboardDevice.cs (17)
144isValid = Keyboard.IsFocusable(focus); 277RoutedEvent = Keyboard.PreviewLostKeyboardFocusEvent, 296RoutedEvent = Keyboard.PreviewGotKeyboardFocusEvent, 312if (keyboardInputProvider != null && Keyboard.IsFocusable(newFocus)) 321RoutedEvent = Keyboard.PreviewKeyboardInputProviderAcquireFocusEvent, 333RoutedEvent = Keyboard.KeyboardInputProviderAcquireFocusEvent, 470RoutedEvent = Keyboard.LostKeyboardFocusEvent, 480RoutedEvent = Keyboard.GotKeyboardFocusEvent, 590if(Keyboard.IsFocusable(element)) 755if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 779else if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 794if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 841keyDown.RoutedEvent=Keyboard.KeyDownEvent; 849if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 895keyUp.RoutedEvent=Keyboard.KeyUpEvent; 927previewKeyDown.RoutedEvent=Keyboard.PreviewKeyDownEvent; 946previewKeyUp.RoutedEvent=Keyboard.PreviewKeyUpEvent;
System\Windows\Input\KeyEventArgs.cs (1)
32if (!Keyboard.IsValidKey(key))
System\Windows\Input\TextCompositionManager.cs (5)
414if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 455if (e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 474if(e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 738if (!Keyboard.IsKeyDown(Key.LeftAlt) && !Keyboard.IsKeyDown(Key.RightAlt))
System\Windows\Input\TextServicesManager.cs (12)
122if(e.StagingItem.Input.RoutedEvent != Keyboard.PreviewKeyDownEvent && 123e.StagingItem.Input.RoutedEvent != Keyboard.PreviewKeyUpEvent) 136DependencyObject element = Keyboard.FocusedElement as DependencyObject; 172DependencyObject element = Keyboard.FocusedElement as DependencyObject; 180if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent || 181e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 202else if(e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent || 203e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 241if (keyArgs.RoutedEvent == Keyboard.PreviewKeyDownEvent/*keyArgs.IsDown*/) 258if (Keyboard.IsKeyDown(Key.LeftAlt) || 259Keyboard.IsKeyDown(Key.RightAlt) || 260Keyboard.IsKeyDown(Key.F10))
System\Windows\InterOp\HwndKeyboardInputProvider.cs (5)
34Keyboard.Focus(null); // internally we will set the focus to the root. 347DependencyObject focusedDO = Keyboard.FocusedElement as DependencyObject; 486Keyboard.Focus(restoreFocusDO as IInputElement); 496restoreFocusDO = (DependencyObject)Keyboard.FocusedElement; 502Keyboard.ClearFocus();
System\Windows\InterOp\HwndSource.cs (12)
2067DependencyObject focusObject = Keyboard.FocusedElement as DependencyObject; 2325Keyboard.PrimaryDevice.ForceTarget = focusElement; 2330Keyboard.PrimaryDevice.ForceTarget = null; 2352keyPreviewEvent = Keyboard.PreviewKeyUpEvent; 2353keyEvent = Keyboard.KeyUpEvent; 2357keyPreviewEvent = Keyboard.PreviewKeyDownEvent; 2358keyEvent = Keyboard.KeyDownEvent; 2374focusElement = Keyboard.PrimaryDevice.FocusedElement; 2383Keyboard.PrimaryDevice.ForceTarget = focusSink as IInputElement; 2387KeyEventArgs tunnelArgs = new KeyEventArgs(Keyboard.PrimaryDevice, this, msg.time, key) 2399KeyEventArgs bubbleArgs = new KeyEventArgs(Keyboard.PrimaryDevice, this, msg.time, key) 2423Keyboard.PrimaryDevice.ForceTarget = null;
System\Windows\InterOp\HwndSourceParameters.cs (1)
259get { return _restoreFocusMode ?? Keyboard.DefaultRestoreFocusMode; }
System\Windows\UIElement.cs (3)
2371Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 2580return (Keyboard.FocusedElement == this); 2588if (Keyboard.Focus(this) == this)
System\Windows\UIElement3D.cs (3)
350Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 559return (Keyboard.FocusedElement == this); 567if (Keyboard.Focus(this) == this)
PresentationFramework (190)
MS\Internal\Documents\DocumentGrid.cs (2)
1258bool altKeyDown = Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt);
MS\Internal\Documents\DocumentViewerHelper.cs (1)
340DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\Button.cs (3)
88b.UpdateIsDefaulted(Keyboard.FocusedElement); 106b.UpdateIsDefaulted(Keyboard.FocusedElement); 190UpdateIsDefaulted(Keyboard.FocusedElement);
System\Windows\Controls\CalendarKeyboardHelper.cs (2)
13ctrl = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 14shift = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift;
System\Windows\Controls\ComboBox.cs (10)
1127DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject; 1347NavigateByLine(HighlightedInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1367NavigateByLine(HighlightedInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1406NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1421NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1436NavigateByLine(HighlightedInfo, FocusNavigationDirection.Right, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1459NavigateByLine(HighlightedInfo, FocusNavigationDirection.Left, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1480NavigateByPage(HighlightedInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1488NavigateByPage(HighlightedInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1494if (Keyboard.Modifiers == ModifierKeys.Control)
System\Windows\Controls\ContextMenu.cs (4)
425NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 434NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 599if (Keyboard.FocusedElement != null) 601_weakRefToPreviousFocus = new WeakReference<IInputElement>(Keyboard.FocusedElement);
System\Windows\Controls\DataGrid.cs (21)
1361(Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift; 5299(_isDraggingSelection || ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)); 5311return (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 5547UIElement startElement = Keyboard.FocusedElement as UIElement; 5548ContentElement startContentElement = (startElement == null) ? Keyboard.FocusedElement as ContentElement : null; 5561Keyboard.Focus(nextFocusTarget as IInputElement); 5675Keyboard.Focus(nextFocusTarget as IInputElement); 5721Keyboard.Focus(nextFocusTarget as IInputElement); 5755Keyboard.Focus(nextFocusTarget as IInputElement); 5790Keyboard.Focus(nextFocusTarget as IInputElement); 5837FrameworkElement startingElement = Keyboard.FocusedElement as FrameworkElement; 5844new ItemNavigateArgs(e.KeyboardDevice, Keyboard.Modifiers), 5881UIElement startElement = Keyboard.FocusedElement as UIElement; 5882ContentElement startContentElement = (startElement == null) ? Keyboard.FocusedElement as ContentElement : null; 5895if (wasEditing && previous && Keyboard.FocusedElement == currentCellContainer) 5987DataGridCell newCell = Keyboard.FocusedElement as DataGridCell; 6138startingElement = Keyboard.FocusedElement as FrameworkElement; 6158PrepareToNavigateByPage(startingInfo, startingElement, direction, new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), out targetElement); 7083(Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift); 7128if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
System\Windows\Controls\DataGridCell.cs (2)
891bool isCtrlKeyPressed = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 959ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask;
System\Windows\Controls\DataGridCheckBoxColumn.cs (1)
214keyArgs.RoutedEvent == Keyboard.KeyDownEvent &&
System\Windows\Controls\DataGridComboBoxColumn.cs (1)
598if ((keyArgs != null) && keyArgs.RoutedEvent == Keyboard.KeyDownEvent && ((keyArgs.KeyStates & KeyStates.Down) == KeyStates.Down))
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
287Debug.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)
269Debug.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)
1160if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
System\Windows\Controls\DocumentViewer.cs (2)
1217if (Keyboard.IsKeyDown(Key.LeftCtrl) || 1218Keyboard.IsKeyDown(Key.RightCtrl))
System\Windows\Controls\FlowDocumentReader.cs (3)
59EventManager.RegisterClassHandler(typeof(FlowDocumentReader), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 922focusedElement = Keyboard.FocusedElement as DependencyObject; 979DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\FlowDocumentScrollViewer.cs (2)
67EventManager.RegisterClassHandler(typeof(FlowDocumentScrollViewer), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 700if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
System\Windows\Controls\ItemsControl.cs (8)
57EventManager.RegisterClassHandler(typeof(ItemsControl), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus)); 1833DependencyObject startingElement = Keyboard.FocusedElement as DependencyObject; 2183return NavigateByPage(FocusedInfo, Keyboard.FocusedElement as FrameworkElement, direction, itemNavigateArgs); 2575if (container == null || Keyboard.IsFocusable(container)) 3341NavigateByLine(startingInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3346NavigateByLine(startingInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3361NavigateByLine(startingInfo, direction, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3371NavigateByLine(startingInfo, direction, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers));
System\Windows\Controls\ListBox.cs (25)
74EventManager.RegisterClassHandler(typeof(ListBox), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 315if (((Keyboard.Modifiers) == (ModifierKeys.Control)) && (SelectionMode == SelectionMode.Extended)) 328if (((Keyboard.Modifiers) == (ModifierKeys.Control)) && (SelectionMode == SelectionMode.Extended)) 371new ItemNavigateArgs(e.Device, Keyboard.Modifiers))) 385NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 389NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 405if ((Keyboard.Modifiers & (ModifierKeys.Control|ModifierKeys.Alt)) == ModifierKeys.Alt) 413if (IsTextSearchEnabled && Keyboard.Modifiers == ModifierKeys.None) 430if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 446if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == ModifierKeys.Control) 451else if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == ModifierKeys.Shift) 456else if ((Keyboard.Modifiers & ModifierKeys.Shift) == 0) 476NavigateByPage(FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 480NavigateByPage(FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 496ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask; 713else if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 730if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == (ModifierKeys.Control | ModifierKeys.Shift)) 734else if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 738else if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 752if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == 0) 769NavigateToItem(ItemInfoFromContainer(listItem), new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 913if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) 924if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 926bool clearCurrentSelection = (Keyboard.Modifiers & ModifierKeys.Control) == 0; 929else if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
System\Windows\Controls\Menu.cs (2)
321if (!(Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt)))
System\Windows\Controls\MenuItem.cs (10)
1895if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 1897NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1901NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1944NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1954NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 2327NavigateToStart(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers)); 2362object previousFocus = Keyboard.FocusedElement; 2363parent.NavigateByLine(parent.FocusedInfo, KeyboardNavigation.KeyToTraversalDirection(key), new ItemNavigateArgs(Keyboard.PrimaryDevice, modifiers)); 2364object currentFocus = Keyboard.FocusedElement;
System\Windows\Controls\PopupControlService.cs (7)
106else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 110else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 122else if (e.StagingItem.Input.RoutedEvent == Keyboard.GotKeyboardFocusEvent) 126else if (e.StagingItem.Input.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 219ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask; 252(Keyboard.Modifiers == ModifierKeys.None) && (CurrentToolTip?.FromKeyboard ?? false)) 266DependencyObject owner = FindToolTipOwner(Keyboard.FocusedElement, ToolTipService.TriggerAction.KeyboardShortcut);
System\Windows\Controls\Primitives\ButtonBase.cs (3)
529Keyboard.Focus(null); 604if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Alt)) != ModifierKeys.Alt) 668if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Alt)) != ModifierKeys.Alt)
System\Windows\Controls\Primitives\MenuBase.cs (4)
57EventManager.RegisterClassHandler(typeof(MenuBase), Keyboard.PreviewKeyboardInputProviderAcquireFocusEvent, new KeyboardInputProviderAcquireFocusEventHandler(OnPreviewKeyboardInputProviderAcquireFocus), true); 58EventManager.RegisterClassHandler(typeof(MenuBase), Keyboard.KeyboardInputProviderAcquireFocusEvent, new KeyboardInputProviderAcquireFocusEventHandler(OnKeyboardInputProviderAcquireFocus), true); 663 Keyboard.Focus(null); 672Keyboard.ClearFocus();
System\Windows\Controls\Primitives\ScrollBar.cs (1)
139((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift))
System\Windows\Controls\Primitives\Selector.cs (1)
1314DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\Primitives\TextBoxBase.cs (1)
2102if (Keyboard.FocusedElement == textBox)
System\Windows\Controls\ScrollViewer.cs (1)
946DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\SinglePageViewer.cs (2)
63EventManager.RegisterClassHandler(typeof(FlowDocumentPageViewer), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 423if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
System\Windows\Controls\Slider.cs (1)
174if (keyEventArgs != null && slider != null && Keyboard.Modifiers == ModifierKeys.None)
System\Windows\Controls\StickyNote.cs (2)
533ContextMenu menu = Keyboard.FocusedElement as ContextMenu; 1357Keyboard.Focus(null);
System\Windows\Controls\TabItem.cs (5)
295if (e.OldFocus != Keyboard.FocusedElement) 328if (e.OldFocus != Keyboard.FocusedElement) 354if (Keyboard.FocusedElement is DependencyObject focusedElement) 357if (thisFocusScope != null && Keyboard.FocusedElement is DependencyObject currentFocus) 480TabItem currentFocus = Keyboard.FocusedElement as TabItem;
System\Windows\Controls\TextSearch.cs (1)
226_attachedTo.NavigateToItem(matchedItem, matchedItemIndex, new ItemsControl.ItemNavigateArgs(Keyboard.PrimaryDevice, ModifierKeys.None));
System\Windows\Controls\ToolBar.cs (2)
258Keyboard.Focus(null); 657Keyboard.Focus(null);
System\Windows\Controls\TreeView.cs (9)
598return ((Keyboard.Modifiers & ModifierKeys.Control) == (ModifierKeys.Control)); 606return ((Keyboard.Modifiers & ModifierKeys.Shift) == (ModifierKeys.Shift)); 613return NavigateToStartInternal(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), true /*shouldFocus*/, out container); 620return NavigateToEndInternal(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), true /*shouldFocus*/, out container); 700IInputElement originalFocusedElement = Keyboard.FocusedElement; 713new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 753DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\TreeViewItem.cs (4)
646return ((Keyboard.Modifiers & ModifierKeys.Control) == (ModifierKeys.Control)); 674IInputElement originalFocus = Keyboard.FocusedElement; 689new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 703DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Documents\FixedPage.cs (2)
96if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
System\Windows\Documents\Hyperlink.cs (2)
493if (IsEnabled && (!IsEditable || ((Keyboard.Modifiers & ModifierKeys.Control) != 0))) 808if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
System\windows\Documents\TextEditor.cs (2)
384EventManager.RegisterClassHandler(controlType, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 385EventManager.RegisterClassHandler(controlType, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus));
System\windows\Documents\TextEditorMouse.cs (4)
101else if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0 && This.Selection.IsEmpty) 108else if (clickCount == 3 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0) 183if (This.UiScope != Keyboard.FocusedElement) 634return This.UiScope == Keyboard.FocusedElement &&
System\windows\Documents\TextEditorTyping.cs (3)
55EventManager.RegisterClassHandler(controlType, Keyboard.PreviewKeyDownEvent, new KeyEventHandler(OnPreviewKeyDown)); 56EventManager.RegisterClassHandler(controlType, Keyboard.KeyDownEvent, new KeyEventHandler(OnKeyDown)); 57EventManager.RegisterClassHandler(controlType, Keyboard.KeyUpEvent, new KeyEventHandler(OnKeyUp));
System\windows\Documents\TextSelection.cs (3)
780if ((Keyboard.Modifiers & ModifierKeys.Shift) != 0) 890bool disableWordExpansion = _textEditor.AutoWordSelection == false || ((Keyboard.Modifiers & ModifierKeys.Shift) != 0 && (Keyboard.Modifiers & ModifierKeys.Control) != 0);
System\Windows\Documents\TextStore.cs (3)
1192if (Keyboard.FocusedElement == UiScope) 2980if ((Keyboard.Modifiers & ModifierKeys.Shift) != 0) 2984if ((Keyboard.Modifiers & ModifierKeys.Control) != 0)
System\Windows\FrameworkContentElement.cs (2)
92EventManager.RegisterClassHandler(typeof(FrameworkContentElement), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 93EventManager.RegisterClassHandler(typeof(FrameworkContentElement), Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus));
System\Windows\FrameworkElement.cs (7)
2371EventManager.RegisterClassHandler(_typeofThis, Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnPreviewGotKeyboardFocus)); 2372EventManager.RegisterClassHandler(_typeofThis, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 2373EventManager.RegisterClassHandler(_typeofThis, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus)); 5334if (activeElement != null && activeElement != sender && Keyboard.IsFocusable(activeElement as DependencyObject)) 5336IInputElement oldFocus = Keyboard.FocusedElement; 5339if (Keyboard.FocusedElement == activeElement || Keyboard.FocusedElement != oldFocus)
System\Windows\Input\KeyboardNavigation.cs (13)
831Current.ShowFocusVisual(Keyboard.FocusedElement as DependencyObject); 967return Navigate(currentElement, request, Keyboard.Modifiers); 1181if(inputEventArgs.RoutedEvent != Keyboard.KeyDownEvent) 2726sourceUIElement.RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2730sourceContentElement?.RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2740targetContentElement?.AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus), true); 2751targetUIElement.AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus), true); 2779((UIElement)sender).RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2781((ContentElement)sender).RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 3152if (inputEventArgs.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 3163else if (inputEventArgs.RoutedEvent == Keyboard.KeyDownEvent) 3175if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Windows)) == ModifierKeys.None) 3194else if (inputEventArgs.RoutedEvent == Keyboard.KeyUpEvent)
System\Windows\Interop\ActiveXHost.cs (2)
74EventManager.RegisterClassHandler(typeof(ActiveXHost), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus)); 75EventManager.RegisterClassHandler(typeof(ActiveXHost), Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostFocus));
System\Windows\Navigation\NavigationService.cs (1)
809Keyboard.PrimaryDevice.Focus(null);
System.Windows.Controls.Ribbon (30)
Microsoft\Windows\Controls\KeyTipService.cs (8)
634(Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift && 635(Keyboard.Modifiers & ModifierKeys.Control) != ModifierKeys.Control); 685if (routedEvent == Keyboard.PreviewKeyUpEvent) 703else if (routedEvent == Keyboard.PreviewKeyDownEvent) 716if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 946object oldFocusedElement = Keyboard.FocusedElement; 959object newFocusedElement = Keyboard.FocusedElement; 1269return ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt);
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (4)
1972RibbonGroup ribbonGroup = TreeHelper.FindVisualAncestor<RibbonGroup>(Keyboard.FocusedElement as DependencyObject); 2046RibbonControl ribbonControl = TreeHelper.FindVisualAncestor<RibbonControl>(Keyboard.FocusedElement as DependencyObject); 2078!TreeHelper.IsVisualAncestorOf(targetControl, Keyboard.FocusedElement as DependencyObject)) 2217DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (5)
1043bool shiftPressed = ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift); 1196DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject; 1444RibbonGalleryItem focusedGalleryItem = Keyboard.FocusedElement as RibbonGalleryItem; 1604_firstGallery.RemoveHandler(Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGalleryGotKeyboardFocus)); 1617_firstGallery.AddHandler(Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGalleryGotKeyboardFocus), true);
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (1)
2673DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonGalleryItem.cs (2)
417if ((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt) 450if ((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (3)
481UIElement uie = Keyboard.FocusedElement as UIElement; 486ContentElement ce = Keyboard.FocusedElement as ContentElement; 1209Keyboard.Focus(null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
804DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject; 857if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
909if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
370DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonTabHeader.cs (2)
530if (!((bool)e.NewValue) && Keyboard.FocusedElement == d) 532Keyboard.Focus(null);
Microsoft\Windows\Controls\Ribbon\RibbonToolTipService.cs (1)
35if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent)