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)
357AutomationPeer focusedPeer = AutomationPeer.AutomationPeerFromInputElement(Keyboard.FocusedElement);
MS\Internal\Interop\TipTsfHelper.cs (1)
81if (Keyboard.FocusedElement == focusedObject)
MS\Internal\SynchronizedInputHelper.cs (5)
50return (re == Keyboard.KeyUpEvent || 51re == Keyboard.KeyDownEvent || 120return args.RoutedEvent == Keyboard.KeyDownEvent; 277e = new RoutedEvent[] {Keyboard.KeyUpEvent}; 280e = new RoutedEvent[] {Keyboard.KeyDownEvent, TextCompositionManager.TextInputEvent};
System\Windows\Automation\Peers\ContentElementAutomationPeer.cs (1)
188return Keyboard.IsFocusable(_owner);
System\Windows\Automation\Peers\UIElement3DAutomationPeer.cs (1)
295return Keyboard.IsFocusable(_owner);
System\Windows\Automation\Peers\UIElementAutomationPeer.cs (1)
343return Keyboard.IsFocusable(_owner);
System\Windows\ContentElement.cs (3)
277Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 480return (Keyboard.FocusedElement == this); 488if (Keyboard.Focus(this) == this)
System\Windows\Generated\ContentElement.cs (24)
1637public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 1644add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 1645remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 1656public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 1663add { AddHandler(Keyboard.KeyDownEvent, value, false); } 1664remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 1675public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 1682add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 1683remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 1694public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 1701add { AddHandler(Keyboard.KeyUpEvent, value, false); } 1702remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 1713public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 1720add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 1721remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 1732public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 1739add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 1740remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 1751public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 1758add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 1759remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 1770public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 1777add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 1778remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Generated\UIElement.cs (32)
783EventManager.RegisterClassHandler(type, Keyboard.PreviewKeyDownEvent, new KeyEventHandler(UIElement.OnPreviewKeyDownThunk), false); 784EventManager.RegisterClassHandler(type, Keyboard.KeyDownEvent, new KeyEventHandler(UIElement.OnKeyDownThunk), false); 785EventManager.RegisterClassHandler(type, Keyboard.PreviewKeyUpEvent, new KeyEventHandler(UIElement.OnPreviewKeyUpThunk), false); 786EventManager.RegisterClassHandler(type, Keyboard.KeyUpEvent, new KeyEventHandler(UIElement.OnKeyUpThunk), false); 787EventManager.RegisterClassHandler(type, Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnPreviewGotKeyboardFocusThunk), false); 788EventManager.RegisterClassHandler(type, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnGotKeyboardFocusThunk), false); 789EventManager.RegisterClassHandler(type, Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnPreviewLostKeyboardFocusThunk), false); 790EventManager.RegisterClassHandler(type, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(UIElement.OnLostKeyboardFocusThunk), false); 3590public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 3597add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 3598remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 3609public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 3616add { AddHandler(Keyboard.KeyDownEvent, value, false); } 3617remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 3628public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 3635add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 3636remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 3647public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 3654add { AddHandler(Keyboard.KeyUpEvent, value, false); } 3655remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 3666public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 3673add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 3674remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 3685public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 3692add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 3693remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 3704public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 3711add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 3712remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 3723public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 3730add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 3731remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Generated\UIElement3D.cs (24)
1358public static readonly RoutedEvent PreviewKeyDownEvent = Keyboard.PreviewKeyDownEvent.AddOwner(_typeofThis); 1365add { AddHandler(Keyboard.PreviewKeyDownEvent, value, false); } 1366remove { RemoveHandler(Keyboard.PreviewKeyDownEvent, value); } 1377public static readonly RoutedEvent KeyDownEvent = Keyboard.KeyDownEvent.AddOwner(_typeofThis); 1384add { AddHandler(Keyboard.KeyDownEvent, value, false); } 1385remove { RemoveHandler(Keyboard.KeyDownEvent, value); } 1396public static readonly RoutedEvent PreviewKeyUpEvent = Keyboard.PreviewKeyUpEvent.AddOwner(_typeofThis); 1403add { AddHandler(Keyboard.PreviewKeyUpEvent, value, false); } 1404remove { RemoveHandler(Keyboard.PreviewKeyUpEvent, value); } 1415public static readonly RoutedEvent KeyUpEvent = Keyboard.KeyUpEvent.AddOwner(_typeofThis); 1422add { AddHandler(Keyboard.KeyUpEvent, value, false); } 1423remove { RemoveHandler(Keyboard.KeyUpEvent, value); } 1434public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = Keyboard.PreviewGotKeyboardFocusEvent.AddOwner(_typeofThis); 1441add { AddHandler(Keyboard.PreviewGotKeyboardFocusEvent, value, false); } 1442remove { RemoveHandler(Keyboard.PreviewGotKeyboardFocusEvent, value); } 1453public static readonly RoutedEvent GotKeyboardFocusEvent = Keyboard.GotKeyboardFocusEvent.AddOwner(_typeofThis); 1460add { AddHandler(Keyboard.GotKeyboardFocusEvent, value, false); } 1461remove { RemoveHandler(Keyboard.GotKeyboardFocusEvent, value); } 1472public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = Keyboard.PreviewLostKeyboardFocusEvent.AddOwner(_typeofThis); 1479add { AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, value, false); } 1480remove { RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, value); } 1491public static readonly RoutedEvent LostKeyboardFocusEvent = Keyboard.LostKeyboardFocusEvent.AddOwner(_typeofThis); 1498add { AddHandler(Keyboard.LostKeyboardFocusEvent, value, false); } 1499remove { RemoveHandler(Keyboard.LostKeyboardFocusEvent, value); }
System\Windows\Input\AccessKeyManager.cs (2)
211if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 369(scope is PresentationSource) && (Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt)
System\Windows\Input\Command\CommandDevice.cs (5)
40return Keyboard.FocusedElement; 113else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent || 115e.StagingItem.Input.RoutedEvent == Keyboard.GotKeyboardFocusEvent || 116e.StagingItem.Input.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 289return Keyboard.FocusedElement;
System\Windows\Input\Command\KeyGesture.cs (1)
183return ( ( (int)Key == (int)keyEventArgs.RealKey ) && ( this.Modifiers == Keyboard.Modifiers ) );
System\Windows\Input\Command\MouseGesture.cs (1)
136return ( ( (int)this.MouseAction == (int)mouseAction ) && ( this.Modifiers == Keyboard.Modifiers ) );
System\Windows\Input\Command\RoutedCommand.cs (5)
93Execute(parameter, FilterInputElement(Keyboard.FocusedElement)); 104return CanExecuteImpl(parameter, FilterInputElement(Keyboard.FocusedElement), false, out unused); 139target = FilterInputElement(Keyboard.FocusedElement); 175target = FilterInputElement(Keyboard.FocusedElement); 375target = FilterInputElement(Keyboard.FocusedElement);
System\Windows\Input\DefaultTextStore.cs (2)
150_composition = new DefaultTextStoreTextComposition(InputManager.Current, Keyboard.FocusedElement, result, TextCompositionAutoComplete.On); 180_composition = new DefaultTextStoreTextComposition(InputManager.Current, Keyboard.FocusedElement, "", TextCompositionAutoComplete.Off);
System\Windows\Input\FocusManager.cs (3)
231DependencyObject oldFocus = Keyboard.FocusedElement as DependencyObject; 233DependencyObject newFocus = Keyboard.FocusedElement as DependencyObject; 243Keyboard.Focus(newFocusedElement);
System\Windows\Input\InputMethod.cs (8)
550IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 587hwnd = HwndFromInputElement(Keyboard.FocusedElement); 783IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 834hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1041IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1115IntPtr hwnd = HwndFromInputElement(Keyboard.FocusedElement); 1307if (inputElement == Keyboard.FocusedElement) 1341hwnd = HwndFromInputElement(Keyboard.FocusedElement);
System\Windows\Input\Keyboard.cs (20)
27public static readonly RoutedEvent PreviewKeyDownEvent = EventManager.RegisterRoutedEvent("PreviewKeyDown", RoutingStrategy.Tunnel, typeof(KeyEventHandler), typeof(Keyboard)); 52public static readonly RoutedEvent KeyDownEvent = EventManager.RegisterRoutedEvent("KeyDown", RoutingStrategy.Bubble, typeof(KeyEventHandler), typeof(Keyboard)); 77public static readonly RoutedEvent PreviewKeyUpEvent = EventManager.RegisterRoutedEvent("PreviewKeyUp", RoutingStrategy.Tunnel, typeof(KeyEventHandler), typeof(Keyboard)); 102public static readonly RoutedEvent KeyUpEvent = EventManager.RegisterRoutedEvent("KeyUp", RoutingStrategy.Bubble, typeof(KeyEventHandler), typeof(Keyboard)); 127public static readonly RoutedEvent PreviewGotKeyboardFocusEvent = EventManager.RegisterRoutedEvent("PreviewGotKeyboardFocus", RoutingStrategy.Tunnel, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 152public static readonly RoutedEvent PreviewKeyboardInputProviderAcquireFocusEvent = EventManager.RegisterRoutedEvent("PreviewKeyboardInputProviderAcquireFocus", RoutingStrategy.Tunnel, typeof(KeyboardInputProviderAcquireFocusEventHandler), typeof(Keyboard)); 177public static readonly RoutedEvent KeyboardInputProviderAcquireFocusEvent = EventManager.RegisterRoutedEvent("KeyboardInputProviderAcquireFocus", RoutingStrategy.Bubble, typeof(KeyboardInputProviderAcquireFocusEventHandler), typeof(Keyboard)); 202public static readonly RoutedEvent GotKeyboardFocusEvent = EventManager.RegisterRoutedEvent("GotKeyboardFocus", RoutingStrategy.Bubble, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 227public static readonly RoutedEvent PreviewLostKeyboardFocusEvent = EventManager.RegisterRoutedEvent("PreviewLostKeyboardFocus", RoutingStrategy.Tunnel, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 252public static readonly RoutedEvent LostKeyboardFocusEvent = EventManager.RegisterRoutedEvent("LostKeyboardFocus", RoutingStrategy.Bubble, typeof(KeyboardFocusChangedEventHandler), typeof(Keyboard)); 281return Keyboard.PrimaryDevice.FocusedElement; 290Keyboard.PrimaryDevice.ClearFocus(); 301return Keyboard.PrimaryDevice.Focus(element); 311return Keyboard.PrimaryDevice.DefaultRestoreFocusMode; 316Keyboard.PrimaryDevice.DefaultRestoreFocusMode = value; 327return Keyboard.PrimaryDevice.Modifiers; 336return Keyboard.PrimaryDevice.IsKeyDown(key); 344return Keyboard.PrimaryDevice.IsKeyUp(key); 352return Keyboard.PrimaryDevice.IsKeyToggled(key); 360return Keyboard.PrimaryDevice.GetKeyStates(key);
System\Windows\Input\KeyboardDevice.cs (17)
156isValid = Keyboard.IsFocusable(focus); 288previewLostFocus.RoutedEvent=Keyboard.PreviewLostKeyboardFocusEvent; 305previewGotFocus.RoutedEvent=Keyboard.PreviewGotKeyboardFocusEvent; 320if (keyboardInputProvider != null && Keyboard.IsFocusable(newFocus)) 328acquireFocus.RoutedEvent = Keyboard.PreviewKeyboardInputProviderAcquireFocusEvent; 338acquireFocus.RoutedEvent = Keyboard.KeyboardInputProviderAcquireFocusEvent; 473lostFocus.RoutedEvent=Keyboard.LostKeyboardFocusEvent; 481gotFocus.RoutedEvent=Keyboard.GotKeyboardFocusEvent; 590if(Keyboard.IsFocusable(element)) 758if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 782else if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 797if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 844keyDown.RoutedEvent=Keyboard.KeyDownEvent; 852if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 898keyUp.RoutedEvent=Keyboard.KeyUpEvent; 930previewKeyDown.RoutedEvent=Keyboard.PreviewKeyDownEvent; 949previewKeyUp.RoutedEvent=Keyboard.PreviewKeyUpEvent;
System\Windows\Input\KeyEventArgs.cs (1)
38if (!Keyboard.IsValidKey(key))
System\Windows\Input\TextCompositionManager.cs (5)
424if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 465if (e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent) 484if(e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 742if (!Keyboard.IsKeyDown(Key.LeftAlt) && !Keyboard.IsKeyDown(Key.RightAlt))
System\Windows\Input\TextServicesManager.cs (12)
125if(e.StagingItem.Input.RoutedEvent != Keyboard.PreviewKeyDownEvent && 126e.StagingItem.Input.RoutedEvent != Keyboard.PreviewKeyUpEvent) 139DependencyObject element = Keyboard.FocusedElement as DependencyObject; 175DependencyObject element = Keyboard.FocusedElement as DependencyObject; 183if(e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyDownEvent || 184e.StagingItem.Input.RoutedEvent == Keyboard.PreviewKeyUpEvent) 205else if(e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent || 206e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 244if (keyArgs.RoutedEvent == Keyboard.PreviewKeyDownEvent/*keyArgs.IsDown*/) 261if (Keyboard.IsKeyDown(Key.LeftAlt) || 262Keyboard.IsKeyDown(Key.RightAlt) || 263Keyboard.IsKeyDown(Key.F10))
System\Windows\InterOp\HwndKeyboardInputProvider.cs (5)
40Keyboard.Focus(null); // internally we will set the focus to the root. 353DependencyObject focusedDO = Keyboard.FocusedElement as DependencyObject; 492Keyboard.Focus(restoreFocusDO as IInputElement); 502restoreFocusDO = (DependencyObject)Keyboard.FocusedElement; 508Keyboard.ClearFocus();
System\Windows\InterOp\HwndSource.cs (12)
2082DependencyObject focusObject = Keyboard.FocusedElement as DependencyObject; 2340Keyboard.PrimaryDevice.ForceTarget = focusElement; 2345Keyboard.PrimaryDevice.ForceTarget = null; 2367keyPreviewEvent = Keyboard.PreviewKeyUpEvent; 2368keyEvent = Keyboard.KeyUpEvent; 2372keyPreviewEvent = Keyboard.PreviewKeyDownEvent; 2373keyEvent = Keyboard.KeyDownEvent; 2389focusElement = Keyboard.PrimaryDevice.FocusedElement; 2398Keyboard.PrimaryDevice.ForceTarget = focusSink as IInputElement; 2402KeyEventArgs tunnelArgs = new KeyEventArgs(Keyboard.PrimaryDevice, this, msg.time, key); 2412KeyEventArgs bubbleArgs = new KeyEventArgs(Keyboard.PrimaryDevice, this, msg.time, key); 2434Keyboard.PrimaryDevice.ForceTarget = null;
System\Windows\InterOp\HwndSourceParameters.cs (1)
263get { return _restoreFocusMode ?? Keyboard.DefaultRestoreFocusMode; }
System\Windows\UIElement.cs (3)
2384Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 2593return (Keyboard.FocusedElement == this); 2601if (Keyboard.Focus(this) == this)
System\Windows\UIElement3D.cs (3)
365Keyboard.PrimaryDevice.ReevaluateFocusAsync(this, oldParent, isCoreParent); 574return (Keyboard.FocusedElement == this); 582if (Keyboard.Focus(this) == this)
PresentationFramework (190)
MS\Internal\Documents\DocumentGrid.cs (2)
1265bool altKeyDown = Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt);
MS\Internal\Documents\DocumentViewerHelper.cs (1)
342DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\Button.cs (3)
97b.UpdateIsDefaulted(Keyboard.FocusedElement); 115b.UpdateIsDefaulted(Keyboard.FocusedElement); 199UpdateIsDefaulted(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)
1141DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject; 1359NavigateByLine(HighlightedInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1379NavigateByLine(HighlightedInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1418NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1433NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1448NavigateByLine(HighlightedInfo, FocusNavigationDirection.Right, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1471NavigateByLine(HighlightedInfo, FocusNavigationDirection.Left, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1492NavigateByPage(HighlightedInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1500NavigateByPage(HighlightedInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1506if (Keyboard.Modifiers == ModifierKeys.Control)
System\Windows\Controls\ContextMenu.cs (4)
433NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 442NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 606if (Keyboard.FocusedElement != null) 608_weakRefToPreviousFocus = new WeakReference<IInputElement>(Keyboard.FocusedElement);
System\Windows\Controls\DataGrid.cs (21)
1373(Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift; 5340(_isDraggingSelection || ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)); 5352return (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 5588UIElement startElement = Keyboard.FocusedElement as UIElement; 5589ContentElement startContentElement = (startElement == null) ? Keyboard.FocusedElement as ContentElement : null; 5602Keyboard.Focus(nextFocusTarget as IInputElement); 5716Keyboard.Focus(nextFocusTarget as IInputElement); 5762Keyboard.Focus(nextFocusTarget as IInputElement); 5796Keyboard.Focus(nextFocusTarget as IInputElement); 5831Keyboard.Focus(nextFocusTarget as IInputElement); 5878FrameworkElement startingElement = Keyboard.FocusedElement as FrameworkElement; 5885new ItemNavigateArgs(e.KeyboardDevice, Keyboard.Modifiers), 5922UIElement startElement = Keyboard.FocusedElement as UIElement; 5923ContentElement startContentElement = (startElement == null) ? Keyboard.FocusedElement as ContentElement : null; 5936if (wasEditing && previous && Keyboard.FocusedElement == currentCellContainer) 6031DataGridCell newCell = Keyboard.FocusedElement as DataGridCell; 6182startingElement = Keyboard.FocusedElement as FrameworkElement; 6202PrepareToNavigateByPage(startingInfo, startingElement, direction, new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), out targetElement); 7126(Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift); 7171if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
System\Windows\Controls\DataGridCell.cs (2)
906bool isCtrlKeyPressed = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control; 977ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask;
System\Windows\Controls\DataGridCheckBoxColumn.cs (1)
221keyArgs.RoutedEvent == Keyboard.KeyDownEvent &&
System\Windows\Controls\DataGridComboBoxColumn.cs (1)
603if ((keyArgs != null) && keyArgs.RoutedEvent == Keyboard.KeyDownEvent && ((keyArgs.KeyStates & KeyStates.Down) == KeyStates.Down))
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
294Debug.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)
272Debug.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)
1165if ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
System\Windows\Controls\DocumentViewer.cs (2)
1283if (Keyboard.IsKeyDown(Key.LeftCtrl) || 1284Keyboard.IsKeyDown(Key.RightCtrl))
System\Windows\Controls\FlowDocumentReader.cs (3)
64EventManager.RegisterClassHandler(typeof(FlowDocumentReader), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 933focusedElement = Keyboard.FocusedElement as DependencyObject; 990DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\FlowDocumentScrollViewer.cs (2)
70EventManager.RegisterClassHandler(typeof(FlowDocumentScrollViewer), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 707if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
System\Windows\Controls\ItemsControl.cs (8)
66EventManager.RegisterClassHandler(typeof(ItemsControl), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus)); 1872DependencyObject startingElement = Keyboard.FocusedElement as DependencyObject; 2222return NavigateByPage(FocusedInfo, Keyboard.FocusedElement as FrameworkElement, direction, itemNavigateArgs); 2614if (container == null || Keyboard.IsFocusable(container)) 3380NavigateByLine(startingInfo, FocusNavigationDirection.Up, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3385NavigateByLine(startingInfo, FocusNavigationDirection.Down, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3400NavigateByLine(startingInfo, direction, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 3410NavigateByLine(startingInfo, direction, new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers));
System\Windows\Controls\ListBox.cs (25)
80EventManager.RegisterClassHandler(typeof(ListBox), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 322if (((Keyboard.Modifiers) == (ModifierKeys.Control)) && (SelectionMode == SelectionMode.Extended)) 335if (((Keyboard.Modifiers) == (ModifierKeys.Control)) && (SelectionMode == SelectionMode.Extended)) 378new ItemNavigateArgs(e.Device, Keyboard.Modifiers))) 392NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 396NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 412if ((Keyboard.Modifiers & (ModifierKeys.Control|ModifierKeys.Alt)) == ModifierKeys.Alt) 420if (IsTextSearchEnabled && Keyboard.Modifiers == ModifierKeys.None) 437if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 453if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == ModifierKeys.Control) 458else if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == ModifierKeys.Shift) 463else if ((Keyboard.Modifiers & ModifierKeys.Shift) == 0) 483NavigateByPage(FocusNavigationDirection.Up, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 487NavigateByPage(FocusNavigationDirection.Down, new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 503ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask; 718else if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 735if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == (ModifierKeys.Control | ModifierKeys.Shift)) 739else if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) 743else if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 757if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift)) == 0) 774NavigateToItem(ItemInfoFromContainer(listItem), new ItemNavigateArgs(Mouse.PrimaryDevice, Keyboard.Modifiers)); 921if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) 932if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 934bool clearCurrentSelection = (Keyboard.Modifiers & ModifierKeys.Control) == 0; 937else if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
System\Windows\Controls\Menu.cs (2)
331if (!(Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt)))
System\Windows\Controls\MenuItem.cs (10)
1912if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) 1914NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1918NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1961NavigateToStart(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 1971NavigateToEnd(new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 2342NavigateToStart(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers)); 2377object previousFocus = Keyboard.FocusedElement; 2378parent.NavigateByLine(parent.FocusedInfo, KeyboardNavigation.KeyToTraversalDirection(key), new ItemNavigateArgs(Keyboard.PrimaryDevice, modifiers)); 2379object currentFocus = Keyboard.FocusedElement;
System\Windows\Controls\PopupControlService.cs (7)
116else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 120else if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyUpEvent) 132else if (e.StagingItem.Input.RoutedEvent == Keyboard.GotKeyboardFocusEvent) 136else if (e.StagingItem.Input.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 229ModifierKeys modifierKeys = Keyboard.Modifiers & ModifierMask; 262(Keyboard.Modifiers == ModifierKeys.None) && (CurrentToolTip?.FromKeyboard ?? false)) 276DependencyObject owner = FindToolTipOwner(Keyboard.FocusedElement, ToolTipService.TriggerAction.KeyboardShortcut);
System\Windows\Controls\Primitives\ButtonBase.cs (3)
540Keyboard.Focus(null); 615if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Alt)) != ModifierKeys.Alt) 679if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Alt)) != ModifierKeys.Alt)
System\Windows\Controls\Primitives\MenuBase.cs (4)
66EventManager.RegisterClassHandler(typeof(MenuBase), Keyboard.PreviewKeyboardInputProviderAcquireFocusEvent, new KeyboardInputProviderAcquireFocusEventHandler(OnPreviewKeyboardInputProviderAcquireFocus), true); 67EventManager.RegisterClassHandler(typeof(MenuBase), Keyboard.KeyboardInputProviderAcquireFocusEvent, new KeyboardInputProviderAcquireFocusEventHandler(OnKeyboardInputProviderAcquireFocus), true); 672 Keyboard.Focus(null); 681Keyboard.ClearFocus();
System\Windows\Controls\Primitives\ScrollBar.cs (1)
155((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift))
System\Windows\Controls\Primitives\Selector.cs (1)
1326DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\Primitives\TextBoxBase.cs (1)
2181if (Keyboard.FocusedElement == textBox)
System\Windows\Controls\ScrollViewer.cs (1)
954DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\SinglePageViewer.cs (2)
66EventManager.RegisterClassHandler(typeof(FlowDocumentPageViewer), Keyboard.KeyDownEvent, new KeyEventHandler(KeyDownHandler), true); 426if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
System\Windows\Controls\Slider.cs (1)
185if (keyEventArgs != null && slider != null && Keyboard.Modifiers == ModifierKeys.None)
System\Windows\Controls\StickyNote.cs (2)
566ContextMenu menu = Keyboard.FocusedElement as ContextMenu; 1401Keyboard.Focus(null);
System\Windows\Controls\TabItem.cs (5)
302if (e.OldFocus != Keyboard.FocusedElement) 335if (e.OldFocus != Keyboard.FocusedElement) 361if (Keyboard.FocusedElement is DependencyObject focusedElement) 364if (thisFocusScope != null && Keyboard.FocusedElement is DependencyObject currentFocus) 487TabItem currentFocus = Keyboard.FocusedElement as TabItem;
System\Windows\Controls\TextSearch.cs (1)
238_attachedTo.NavigateToItem(matchedItem, matchedItemIndex, new ItemsControl.ItemNavigateArgs(Keyboard.PrimaryDevice, ModifierKeys.None));
System\Windows\Controls\ToolBar.cs (2)
267Keyboard.Focus(null); 672Keyboard.Focus(null);
System\Windows\Controls\TreeView.cs (9)
603return ((Keyboard.Modifiers & ModifierKeys.Control) == (ModifierKeys.Control)); 611return ((Keyboard.Modifiers & ModifierKeys.Shift) == (ModifierKeys.Shift)); 618return NavigateToStartInternal(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), true /*shouldFocus*/, out container); 625return NavigateToEndInternal(new ItemNavigateArgs(Keyboard.PrimaryDevice, Keyboard.Modifiers), true /*shouldFocus*/, out container); 705IInputElement originalFocusedElement = Keyboard.FocusedElement; 720new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 760DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Controls\TreeViewItem.cs (4)
656return ((Keyboard.Modifiers & ModifierKeys.Control) == (ModifierKeys.Control)); 684IInputElement originalFocus = Keyboard.FocusedElement; 701new ItemNavigateArgs(e.Device, Keyboard.Modifiers)); 715DependencyObject currentFocus = Keyboard.FocusedElement as DependencyObject;
System\Windows\Documents\FixedPage.cs (2)
102if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
System\Windows\Documents\Hyperlink.cs (2)
499if (IsEnabled && (!IsEditable || ((Keyboard.Modifiers & ModifierKeys.Control) != 0))) 813if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
System\windows\Documents\TextEditor.cs (2)
398EventManager.RegisterClassHandler(controlType, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 399EventManager.RegisterClassHandler(controlType, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus));
System\windows\Documents\TextEditorMouse.cs (4)
115else if (clickCount == 2 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0 && This.Selection.IsEmpty) 122else if (clickCount == 3 && (Keyboard.Modifiers & ModifierKeys.Shift) == 0) 200if (This.UiScope != Keyboard.FocusedElement) 651return This.UiScope == Keyboard.FocusedElement &&
System\windows\Documents\TextEditorTyping.cs (3)
64EventManager.RegisterClassHandler(controlType, Keyboard.PreviewKeyDownEvent, new KeyEventHandler(OnPreviewKeyDown)); 65EventManager.RegisterClassHandler(controlType, Keyboard.KeyDownEvent, new KeyEventHandler(OnKeyDown)); 66EventManager.RegisterClassHandler(controlType, Keyboard.KeyUpEvent, new KeyEventHandler(OnKeyUp));
System\windows\Documents\TextSelection.cs (3)
798if ((Keyboard.Modifiers & ModifierKeys.Shift) != 0) 908bool disableWordExpansion = _textEditor.AutoWordSelection == false || ((Keyboard.Modifiers & ModifierKeys.Shift) != 0 && (Keyboard.Modifiers & ModifierKeys.Control) != 0);
System\Windows\Documents\TextStore.cs (3)
1206if (Keyboard.FocusedElement == UiScope) 2995if ((Keyboard.Modifiers & ModifierKeys.Shift) != 0) 2999if ((Keyboard.Modifiers & ModifierKeys.Control) != 0)
System\Windows\FrameworkContentElement.cs (2)
113EventManager.RegisterClassHandler(typeof(FrameworkContentElement), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 114EventManager.RegisterClassHandler(typeof(FrameworkContentElement), Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus));
System\Windows\FrameworkElement.cs (7)
2390EventManager.RegisterClassHandler(_typeofThis, Keyboard.PreviewGotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnPreviewGotKeyboardFocus)); 2391EventManager.RegisterClassHandler(_typeofThis, Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus)); 2392EventManager.RegisterClassHandler(_typeofThis, Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus)); 5346if (activeElement != null && activeElement != sender && Keyboard.IsFocusable(activeElement as DependencyObject)) 5348IInputElement oldFocus = Keyboard.FocusedElement; 5351if (Keyboard.FocusedElement == activeElement || Keyboard.FocusedElement != oldFocus)
System\Windows\Input\KeyboardNavigation.cs (13)
840Current.ShowFocusVisual(Keyboard.FocusedElement as DependencyObject); 976return Navigate(currentElement, request, Keyboard.Modifiers); 1188if(inputEventArgs.RoutedEvent != Keyboard.KeyDownEvent) 2736sourceUIElement.RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2741sourceContentElement.RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2753targetContentElement.AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus), true); 2765targetUIElement.AddHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus), true); 2793((UIElement)sender).RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 2795((ContentElement)sender).RemoveHandler(Keyboard.PreviewLostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(_LostFocus)); 3166if (inputEventArgs.RoutedEvent == Keyboard.LostKeyboardFocusEvent) 3177else if (inputEventArgs.RoutedEvent == Keyboard.KeyDownEvent) 3189if ((Keyboard.Modifiers & (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Windows)) == ModifierKeys.None) 3208else if (inputEventArgs.RoutedEvent == Keyboard.KeyUpEvent)
System\Windows\Interop\ActiveXHost.cs (2)
88EventManager.RegisterClassHandler(typeof(ActiveXHost), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus)); 89EventManager.RegisterClassHandler(typeof(ActiveXHost), Keyboard.LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostFocus));
System\Windows\Navigation\NavigationService.cs (1)
840Keyboard.PrimaryDevice.Focus(null);
System.Windows.Controls.Ribbon (30)
Microsoft\Windows\Controls\KeyTipService.cs (8)
639(Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.Shift && 640(Keyboard.Modifiers & ModifierKeys.Control) != ModifierKeys.Control); 690if (routedEvent == Keyboard.PreviewKeyUpEvent) 708else if (routedEvent == Keyboard.PreviewKeyDownEvent) 721if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent) 949object oldFocusedElement = Keyboard.FocusedElement; 962object newFocusedElement = Keyboard.FocusedElement; 1276return ((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt);
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (4)
2000RibbonGroup ribbonGroup = TreeHelper.FindVisualAncestor<RibbonGroup>(Keyboard.FocusedElement as DependencyObject); 2074RibbonControl ribbonControl = TreeHelper.FindVisualAncestor<RibbonControl>(Keyboard.FocusedElement as DependencyObject); 2106!TreeHelper.IsVisualAncestorOf(targetControl, Keyboard.FocusedElement as DependencyObject)) 2245DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (5)
1045bool shiftPressed = ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift); 1198DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject; 1446RibbonGalleryItem focusedGalleryItem = Keyboard.FocusedElement as RibbonGalleryItem; 1606_firstGallery.RemoveHandler(Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGalleryGotKeyboardFocus)); 1619_firstGallery.AddHandler(Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGalleryGotKeyboardFocus), true);
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (1)
2674DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonGalleryItem.cs (2)
419if ((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt) 452if ((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (3)
482UIElement uie = Keyboard.FocusedElement as UIElement; 487ContentElement ce = Keyboard.FocusedElement as ContentElement; 1219Keyboard.Focus(null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (2)
807DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject; 860if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (1)
915if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
378DependencyObject focusedElement = Keyboard.FocusedElement as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonTabHeader.cs (2)
535if (!((bool)e.NewValue) && Keyboard.FocusedElement == d) 537Keyboard.Focus(null);
Microsoft\Windows\Controls\Ribbon\RibbonToolTipService.cs (1)
36if (e.StagingItem.Input.RoutedEvent == Keyboard.KeyDownEvent)