2044 references to Keys
Microsoft.VisualBasic.Forms (9)
Microsoft\VisualBasic\Devices\Keyboard.vb (9)
21Dim keys As Keys = Control.ModifierKeys 22Return CType(keys And Keys.Alt, Boolean) 36Return CType(UnsafeNativeMethods.GetKeyState(Keys.CapsLock) And 1, Boolean) 46Dim keys As Keys = Control.ModifierKeys 47Return CType(keys And Keys.Control, Boolean) 61Return CType(UnsafeNativeMethods.GetKeyState(Keys.NumLock) And 1, Boolean) 75Return CType(UnsafeNativeMethods.GetKeyState(Keys.Scroll) And 1, Boolean) 85Dim keys As Keys = Control.ModifierKeys 86Return CType(keys And Keys.Shift, Boolean)
System.Windows.Forms (1612)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1637protected override bool ProcessDialogKey(Keys keyData) => !_ignoreDialogKeys && base.ProcessDialogKey(keyData);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
379target.SelectNextControl(null, ModifierKeys != Keys.Shift, tabStopOnly: true, nested: true, wrap: true);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (2)
41if (IsInputKey(Keys.Return)) 46if (IsInputKey(Keys.Escape))
System\Windows\Forms\Control.cs (69)
2484private protected static Keys LastKeyData { get; set; } 2596public static Keys ModifierKeys 2600Keys modifiers = 0; 2602if (PInvoke.GetKeyState((int)Keys.ShiftKey) < 0) 2604modifiers |= Keys.Shift; 2607if (PInvoke.GetKeyState((int)Keys.ControlKey) < 0) 2609modifiers |= Keys.Control; 2612if (PInvoke.GetKeyState((int)Keys.Menu) < 0) 2614modifiers |= Keys.Alt; 2631if (PInvoke.GetKeyState((int)Keys.LButton) < 0) 2636if (PInvoke.GetKeyState((int)Keys.RButton) < 0) 2641if (PInvoke.GetKeyState((int)Keys.MButton) < 0) 2646if (PInvoke.GetKeyState((int)Keys.XButton1) < 0) 2651if (PInvoke.GetKeyState((int)Keys.XButton2) < 0) 6293public static bool IsKeyLocked(Keys keyVal) 6295if (keyVal is Keys.Insert or Keys.NumLock or Keys.CapsLock or Keys.Scroll) 6306return keyVal is Keys.Insert or Keys.CapsLock ? (result & 0x1) != 0x0 : (result & 0x8001) != 0x0; 6330int mask = charCode == (char)(int)Keys.Tab 6350protected virtual bool IsInputKey(Keys keyData) 6352if ((keyData & Keys.Alt) == Keys.Alt) 6358switch (keyData & Keys.KeyCode) 6360case Keys.Tab: 6363case Keys.Left: 6364case Keys.Right: 6365case Keys.Up: 6366case Keys.Down: 7743&& (e.KeyCode.HasFlag(Keys.ControlKey) || e.KeyCode == Keys.Escape)) 8607/// For WM_KEYDOWN and WM_SYSKEYDOWN messages, this first calls <see cref="ProcessCmdKey(ref Message, Keys)"/> 8609/// <see cref="IsInputKey(Keys)"/> is called to check whether the key message represents an input key for the 8610/// control. Finally, if <see cref="IsInputKey(Keys)"/> indicates that the control isn't interested in the key 8611/// message, then <see cref="ProcessDialogKey(Keys)"/> is called to check for dialog keys such as TAB, arrow 8631/// <see cref="IsInputKey(Keys)"/>, <see cref="ProcessCmdKey(ref Message, Keys)"/>, <see cref="ProcessDialogChar(char)"/>, 8632/// or <see cref="ProcessDialogKey(Keys)"/>) instead of overriding this method. 8646Keys keyData = (Keys)(nint)msg.WParamInternal | ModifierKeys; 8714Keys keyData = (Keys)(nint)message.WParamInternal | ModifierKeys; 8778/// If the control has a parent, the key is passed to the parent's <see cref="ProcessCmdKey(ref Message, Keys)"/> 8784protected virtual bool ProcessCmdKey(ref Message msg, Keys keyData) => 8899/// arrow keys. This method is called only if the <see cref="IsInputKey(Keys)"/> method indicates that the control 8900/// is not processing the key. The <see cref="ProcessDialogKey(Keys)"/> simply sends the character to the parent's 8901/// <see cref="ProcessDialogKey(Keys)"/> method, or returns <see langword="false"/> if the control has no parent. 8905protected virtual bool ProcessDialogKey(Keys keyData) => _parent?.ProcessDialogKey(keyData) ?? false; 8959ke = new KeyEventArgs((Keys)(int)m.WParamInternal | ModifierKeys); 9041Keys keyCode = (Keys)(nint)msg.WParamInternal & Keys.KeyCode; 9043if (keyCode is not Keys.F10 and not Keys.Menu and not Keys.Tab) 9067if (keyCode is Keys.F10 or Keys.Menu) 9076if (keyCode == Keys.Tab) 12914static bool IsKeyDown(Keys key, ReadOnlySpan<byte> stateArray) 12922return IsKeyDown(Keys.Tab, stateArray) 12923|| IsKeyDown(Keys.Up, stateArray) 12924|| IsKeyDown(Keys.Down, stateArray) 12925|| IsKeyDown(Keys.Left, stateArray) 12926|| IsKeyDown(Keys.Right, stateArray) 12928|| IsKeyDown(Keys.Menu, stateArray) 12929|| IsKeyDown(Keys.F10, stateArray) 12930|| IsKeyDown(Keys.Escape, stateArray);
System\Windows\Forms\Control.ExtendedStates.cs (1)
45/// Used to flag that <see cref="IsInputKey(Keys)"/> returned true in <see cref="PreProcessMessage(ref Message)" />
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (3)
1178if (kevent.KeyData == Keys.Space) 1221if (kevent.KeyCode is Keys.Enter or Keys.Space)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
388if (PInvoke.GetKeyState((int)Keys.Tab) >= 0)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (33)
1447if (keyChar == (char)(int)Keys.Escape) 1451else if (keyChar == (char)(int)Keys.Return && DroppedDown) 2018Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2021if ((Keys)(int)m.WParamInternal == Keys.Delete) 2036Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2038if (keyChar == (char)Keys.Back) 2060else if (keyChar == (char)Keys.Escape) 2066if (keyChar != (char)Keys.Escape && keyChar != (char)Keys.Return && !DroppedDown 2132protected override bool IsInputKey(Keys keyData) 2134Keys keyCode = keyData & (Keys.KeyCode | Keys.Alt); 2135if (keyCode is Keys.Return or Keys.Escape) 2434if (e.KeyCode == Keys.Return) 2439else if ((e.KeyCode == Keys.Escape) && _autoCompleteDroppedDown) 2461if (!e.Handled && (e.KeyChar == (char)(int)Keys.Return || e.KeyChar == (char)(int)Keys.Escape) 2490private static bool ContainsNavigationKeyCode(Keys keyCode) => keyCode switch 2492Keys.Home or Keys.End or Keys.Left or Keys.Right => true, 2918protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 2922if (!returnedValue && keyData == (Keys.Control | Keys.A)) 2933&& (keyData == (Keys.Control | Keys.Back) || keyData == (Keys.Control | Keys.Shift | Keys.Back)))
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (335)
10062protected override bool IsInputKey(Keys keyData) 10064if ((keyData & Keys.Alt) == Keys.Alt) 10069switch (keyData & Keys.KeyCode) 10071case Keys.Escape: 10076case Keys.Tab: 10078return GetTabKeyEffective((keyData & Keys.Shift) == Keys.Shift, (keyData & Keys.Control) == Keys.Control); 10081case Keys.A: 10083if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Control) 10091case Keys.C: 10092case Keys.Insert: 10094if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Control) 10102case Keys.Space: 10104if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift 10115case Keys.Up: 10116case Keys.Down: 10117case Keys.Left: 10118case Keys.Right: 10119case Keys.Home: 10120case Keys.End: 10121case Keys.Next: 10122case Keys.Prior: 10123case Keys.Enter: 10124case Keys.Delete: 10125case Keys.D0: 10126case Keys.NumPad0: 10127case Keys.F2: 10128case Keys.F3: 11892Keys nModifier = ModifierKeys; 11893bool isControlDown = (nModifier & Keys.Control) == Keys.Control && (nModifier & Keys.Alt) == 0; 11894bool isShiftDown = (nModifier & Keys.Shift) == Keys.Shift; 11895bool isAltDown = (nModifier & Keys.Alt) == Keys.Alt; 15694switch (e.KeyData & Keys.KeyCode) 15696case Keys.A: 15697case Keys.C: 15698case Keys.D0: 15699case Keys.NumPad0: 15700case Keys.Delete: 15701case Keys.Down: 15702case Keys.F2: 15703case Keys.F3: 15704case Keys.F10: 15705case Keys.End: 15706case Keys.Enter: 15707case Keys.Escape: 15708case Keys.Home: 15709case Keys.Insert: 15710case Keys.Left: 15711case Keys.Next: 15712case Keys.Prior: 15713case Keys.Right: 15714case Keys.Space: 15715case Keys.Tab: 15716case Keys.Up: 15761if (_dataGridViewOper[OperationTrackKeyboardColResize] && (e.KeyData & Keys.Alt) != Keys.Alt) 16457if ((ModifierKeys & (Keys.Shift | Keys.Alt)) != 0 || MouseButtons != MouseButtons.None) 16462bool verticalScroll = ((ModifierKeys & Keys.Control) == 0); 19913protected bool ProcessAKey(Keys keyData) 19915if ((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == Keys.Control && MultiSelect) 19924protected bool ProcessDeleteKey(Keys keyData) 20051protected override bool ProcessDialogKey(Keys keyData) 20053Keys key = (keyData & Keys.KeyCode); 20055if (key == Keys.Enter) 20062else if (key == Keys.Escape) 20084else if (key is Keys.D0 or Keys.NumPad0) 20091else if (key is Keys.C or Keys.Insert) 20098else if (key == Keys.Tab) 20125keyData &= ~Keys.Control; 20142protected bool ProcessDownKey(Keys keyData) => ProcessDownKeyInternal(keyData, out bool _); 20144private bool ProcessDownKeyInternal(Keys keyData, out bool moved) 20171if ((keyData & Keys.Control) == Keys.Control) 20173if ((keyData & Keys.Shift) == Keys.Shift) 20296if ((keyData & Keys.Shift) == Keys.Shift) 20424if ((keyData & Keys.Control) == Keys.Control) 20426if ((keyData & Keys.Shift) == Keys.Shift) 20538if ((keyData & Keys.Shift) == Keys.Shift) 20660if ((keyData & Keys.Control) == Keys.Control) 20662if ((keyData & Keys.Shift) == Keys.Shift) 20808if ((keyData & Keys.Shift) == Keys.Shift) 20968if ((keyData & Keys.Control) == Keys.Control) 21066protected bool ProcessEndKey(Keys keyData) 21085if ((keyData & Keys.Control) == 0) 21087return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21101if ((keyData & Keys.Shift) == Keys.Shift) 21134if ((keyData & Keys.Control) == 0) 21136return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21150if ((keyData & Keys.Shift) == Keys.Shift) 21211if ((keyData & Keys.Control) == 0) 21213return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21228if ((keyData & Keys.Shift) == Keys.Shift) 21251if ((keyData & Keys.Control) == 0) 21253return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21257if ((keyData & Keys.Shift) == Keys.Shift) 21342if ((keyData & Keys.Control) == 0) 21344return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21359if ((keyData & Keys.Shift) == Keys.Shift) 21395protected bool ProcessEnterKey(Keys keyData) 21402if ((keyData & Keys.Control) == 0) 21406keyData &= ~Keys.Shift; 21477protected bool ProcessEscapeKey(Keys keyData) 21496protected bool ProcessF2Key(Keys keyData) 21525protected bool ProcessF3Key(Keys keyData) 21543protected bool ProcessHomeKey(Keys keyData) 21559if ((keyData & Keys.Control) == 0) 21561return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21575if ((keyData & Keys.Shift) == Keys.Shift) 21608if ((keyData & Keys.Control) == 0) 21610return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21624if ((keyData & Keys.Shift) == Keys.Shift) 21685if ((keyData & Keys.Control) == 0) 21687return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21702if ((keyData & Keys.Shift) == Keys.Shift) 21730if ((keyData & Keys.Control) == 0) 21732return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21736if ((keyData & Keys.Shift) == Keys.Shift) 21821if ((keyData & Keys.Control) == 0) 21823return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21853protected bool ProcessInsertKey(Keys keyData) 21855if (((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == Keys.Control 21856|| ((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == (Keys.Control | Keys.Shift) 21857&& (keyData & Keys.KeyCode) == Keys.C)) 21885KeyEventArgs ke = new((Keys)(nint)m.WParamInternal | ModifierKeys); 21886if (ke.KeyCode != Keys.ProcessKey || m.LParamInternal != 0x01) // Changing IME context does not trigger editing mode 21901if (BeginEditInternal(selectAll: !(ke.KeyCode == Keys.F2 && ModifierKeys == 0 && EditMode == DataGridViewEditMode.EditOnKeystrokeOrF2))) 21933KeyEventArgs ke = new((Keys)(nint)m.WParamInternal | ModifierKeys); 21943Keys.Escape or Keys.Space => true, 21948Keys.Delete 21949or Keys.Down 21950or Keys.End 21951or Keys.Enter 21952or Keys.Escape 21953or Keys.F2 21954or Keys.F3 21955or Keys.Home 21956or Keys.Left 21957or Keys.Next 21958or Keys.Prior 21959or Keys.Right 21960or Keys.Space 21961or Keys.Tab 21962or Keys.Up => true, 22000private bool? ProcessColumnResize(Keys keyData, int step) 22002if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns && _ptCurrentCell.X != -1) 22036protected bool ProcessControlShiftF10Keys(Keys keyData) 22058protected bool ProcessLeftKey(Keys keyData) => RightToLeftInternal 22062private bool ProcessLeftKeyPrivate(Keys keyData) 22098if ((keyData & Keys.Control) == Keys.Control) 22100return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22104if ((keyData & Keys.Shift) == Keys.Shift) 22209if ((keyData & Keys.Control) == Keys.Control) 22211return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22215if ((keyData & Keys.Shift) == Keys.Shift) 22318if ((keyData & Keys.Control) == Keys.Control) 22320return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22324if ((keyData & Keys.Shift) == Keys.Shift) 22462if ((keyData & Keys.Control) == Keys.Control) 22464return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22914protected bool ProcessNextKey(Keys keyData) 23028if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23068if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23104if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23177protected bool ProcessPriorKey(Keys keyData) 23287if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23326if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23362if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23435protected bool ProcessRightKey(Keys keyData) => RightToLeftInternal 23439private bool ProcessRightKeyPrivate(Keys keyData) 23477if ((keyData & Keys.Control) == Keys.Control) 23479return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 23483if ((keyData & Keys.Shift) == Keys.Shift) 23587if ((keyData & Keys.Control) == Keys.Control) 23589return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 23593if ((keyData & Keys.Shift) == Keys.Shift) 23696if ((keyData & Keys.Control) == Keys.Control) 23698return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 23702if ((keyData & Keys.Shift) == Keys.Shift) 23842if ((keyData & Keys.Control) == Keys.Control) 23844return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 24254protected bool ProcessSpaceKey(Keys keyData) 24256if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift && _ptCurrentCell.X != -1) 24339protected bool ProcessTabKey(Keys keyData) 24343if ((keyData & Keys.Control) == Keys.Control) 24345if ((keyData & Keys.Shift) == Keys.Shift) 24379if ((keyData & Keys.Control) == Keys.Control) 24385if ((keyData & Keys.Shift) == Keys.Shift) 24422case Keys.Tab: 24427case Keys.Up: 24432case Keys.Down: 24437case Keys.Next: 24442case Keys.Prior: 24447case Keys.Left: 24452case Keys.Right: 24457case Keys.F2: 24462case Keys.F3: 24467case Keys.F10: 24477case Keys.Home: 24482case Keys.D0: 24483case Keys.NumPad0: 24488case Keys.Delete: 24493case Keys.End: 24498case Keys.Enter: 24503case Keys.Escape: 24508case Keys.A: 24513case Keys.C: 24514case Keys.Insert: 24519case Keys.Space: 24528protected bool ProcessUpKey(Keys keyData) 24551if ((keyData & Keys.Control) == Keys.Control) 24553if ((keyData & Keys.Shift) == Keys.Shift) 24645if ((keyData & Keys.Shift) == Keys.Shift) 24749if ((keyData & Keys.Control) == Keys.Control) 24751if ((keyData & Keys.Shift) == Keys.Shift) 24836if ((keyData & Keys.Shift) == Keys.Shift) 24933if ((keyData & Keys.Control) == Keys.Control) 24935if ((keyData & Keys.Shift) == Keys.Shift) 25054if ((keyData & Keys.Shift) == Keys.Shift) 25186if ((keyData & Keys.Control) == Keys.Control) 25266protected bool ProcessZeroKey(Keys keyData) 25286if ((keyData & (Keys.Alt | Keys.Shift | Keys.Control)) == Keys.Control && IsCurrentCellInEditMode) 30017Keys modifierKeys = ModifierKeys; 30018if (GetTabKeyEffective((modifierKeys & Keys.Shift) == Keys.Shift, (modifierKeys & Keys.Control) == Keys.Control))
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (4)
437e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift; 440e.KeyCode == Keys.Space; 461if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift) 475if (e.KeyCode == Keys.Space)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (3)
1371sb.Append((char)Keys.Return); 1372sb.Append((char)Keys.LineFeed); 1377sb.Append(csv ? ',' : (char)Keys.Tab);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (4)
758e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift; 760protected override bool KeyUpUnsharesRow(KeyEventArgs e, int rowIndex) => e.KeyCode == Keys.Space; 812if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift) 826if (e.KeyCode == Keys.Space)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (3)
193stringBuilder.Append((char)Keys.Return); 194stringBuilder.Append((char)Keys.LineFeed); 199stringBuilder.Append(csv ? ',' : (char)Keys.Tab);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (12)
1509if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >= Keys.F1 && e.KeyCode <= Keys.F24)) || 1510(e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.Divide) || 1511(e.KeyCode >= Keys.OemSemicolon && e.KeyCode <= Keys.Oem102) || 1512(e.KeyCode == Keys.Space && !e.Shift) || 1513(e.KeyCode == Keys.F4) || 1514((e.KeyCode == Keys.Down || e.KeyCode == Keys.Up) && e.Alt)) && 1515(!e.Alt || (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up)) &&
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (7)
89public virtual bool EditingControlWantsInputKey(Keys keyData, bool dataGridViewWantsInputKey) 91var maskedKeyData = keyData & Keys.KeyCode; 92if (maskedKeyData == Keys.Down || 93maskedKeyData == Keys.Up || 94(DroppedDown && (maskedKeyData == Keys.Escape)) || 95maskedKeyData == Keys.Enter)
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (2)
682if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift) 728if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
165stringBuilder.Append((char)Keys.Return); 166stringBuilder.Append((char)Keys.LineFeed); 171stringBuilder.Append(csv ? ',' : (char)Keys.Tab);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (7)
531if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >= Keys.F1 && e.KeyCode <= Keys.F24)) || 532(e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.Divide) || 533(e.KeyCode >= Keys.OemSemicolon && e.KeyCode <= Keys.Oem102) || 534(e.KeyCode == Keys.Space && !e.Shift)) &&
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (23)
122public virtual bool EditingControlWantsInputKey(Keys keyData, bool dataGridViewWantsInputKey) 124switch (keyData & Keys.KeyCode) 126case Keys.Right: 137case Keys.Left: 149case Keys.Down: 160case Keys.Up: 171case Keys.Home: 172case Keys.End: 180case Keys.Prior: 181case Keys.Next: 189case Keys.Delete: 198case Keys.Enter: 199if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift && Multiline && AcceptsReturn) 251switch ((Keys)(nint)m.WParamInternal) 253case Keys.Enter: 255&& !(ModifierKeys == Keys.Shift && Multiline && AcceptsReturn)) 265case Keys.LineFeed: 266if (m.MsgInternal == PInvokeCore.WM_CHAR && ModifierKeys == Keys.Control && Multiline && AcceptsReturn) 274case Keys.A: 275if (m.MsgInternal == PInvokeCore.WM_KEYDOWN && ModifierKeys == Keys.Control)
System\Windows\Forms\Controls\DataGridView\IDataGridViewEditingControl.cs (1)
45bool EditingControlWantsInputKey(Keys keyData, bool dataGridViewWantsInputKey);
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (8)
1028protected override bool IsInputKey(Keys keyData) 1030if ((keyData & Keys.Alt) == Keys.Alt) 1035return (keyData & Keys.KeyCode) switch 1037Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true,
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.DateTimePickerAccessibleObject.cs (1)
136PInvokeCore.SendMessage(owner, PInvokeCore.WM_SYSKEYDOWN, (WPARAM)(int)Keys.Down);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (14)
798if (e.KeyCode == Keys.Enter) 1404protected override bool ProcessDialogKey(Keys keyData) 1406if ((keyData & (Keys.Alt | Keys.Control)) != Keys.Alt) 1408Keys keyCode = keyData & Keys.KeyCode; 1411case Keys.Tab: 1414bool forward = (keyData & Keys.Shift) != Keys.Shift; 1422case Keys.Up: 1423case Keys.Left: 1430case Keys.Down: 1431case Keys.Right:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (10)
918Keys keycode = (Keys)m.WParamInternal.LOWORD; 921Keys.Up or Keys.Down or Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End or Keys.Left or Keys.Right => true,
System\Windows\Forms\Controls\ListControl\ListControl.cs (8)
576protected override bool IsInputKey(Keys keyData) 578if ((keyData & Keys.Alt) == Keys.Alt) 583return (keyData & Keys.KeyCode) switch 585Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true,
System\Windows\Forms\Controls\ListView\ListView.cs (16)
4262protected override bool IsInputKey(Keys keyData) 4264if ((keyData & Keys.Alt) == Keys.Alt) 4269switch (keyData & Keys.KeyCode) 4271case Keys.PageUp: 4272case Keys.PageDown: 4273case Keys.Home: 4274case Keys.End: 4286switch (keyData & Keys.KeyCode) 4288case Keys.Return: 4289case Keys.Escape: 6752if ((lvkd->wVKey == (short)Keys.Down || lvkd->wVKey == (short)Keys.Up) && SelectedItems.Count > 0) 6755if (lvkd->wVKey == (short)Keys.Down 6766if (lvkd->wVKey == (short)Keys.Up 6778if (lvkd->wVKey == (short)Keys.Space)
System\Windows\Forms\Controls\Menus\MenuStrip.cs (3)
225protected override bool ProcessCmdKey(ref Message m, Keys keyData) 230if (keyData == Keys.Space) 241PInvokeCore.PostMessage(ancestor, PInvokeCore.WM_SYSCOMMAND, (WPARAM)PInvoke.SC_KEYMENU, (LPARAM)(int)Keys.Space);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (8)
1331protected override bool IsInputKey(Keys keyData) 1333if ((keyData & Keys.Alt) == Keys.Alt) 1338return (keyData & Keys.KeyCode) switch 1340Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true,
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (6)
3213protected override bool ProcessDialogKey(Keys keyData) 3215if ((keyData & Keys.KeyCode) != Keys.Tab 3216|| keyData.HasFlag(Keys.Control) 3217|| keyData.HasFlag(Keys.Alt)) 3223if (keyData.HasFlag(Keys.Shift))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (77)
1520if (_dropDownHolder?.Visible == true && m.MsgInternal == PInvokeCore.WM_KEYDOWN && (Keys)(nint)m.WParamInternal != Keys.Tab) 1569Keys modifiers = ModifierKeys; 1570if ((modifiers & ~Keys.Shift) != 0) 1586case unchecked((char)(int)(long)Keys.Tab): 2045protected override bool IsInputKey(Keys keyData) 2047switch (keyData & Keys.KeyCode) 2049case Keys.Escape: 2050case Keys.Tab: 2051case Keys.F4: 2054case Keys.Return: 2345if (e.KeyCode == Keys.Return) 2453private bool ProcessEnumUpAndDown(GridEntry entry, Keys keyCode, bool closeDropDown = true) 2481if (keyCode == Keys.Up) 2511if (!e.Alt && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)) 2526else if ((e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) 2527&& (e.Modifiers & ~Keys.Shift) != 0) 2650if ((ModifierKeys & (Keys.Alt | Keys.Control)) != 0) 2732Keys keyCode = e.KeyCode; 2737if (keyCode == Keys.Tab) 2747if (keyCode == Keys.Down && altPressed && DropDownButton.Visible) 2753if (keyCode == Keys.Up && altPressed && DropDownButton.Visible && (_dropDownHolder is not null) && _dropDownHolder.Visible) 2768case Keys.Up: 2769case Keys.Down: 2770int position = keyCode == Keys.Up ? _selectedRow - 1 : _selectedRow + 1; 2774case Keys.Left: 2793case Keys.Right: 2819case Keys.Return: 2830case Keys.Home: 2831case Keys.End: 2833SelectGridEntry(allEntries[keyCode == Keys.Home ? 0 : allEntries.Count - 1], pageIn: true); 2835case Keys.Add: 2836case Keys.Oemplus: 2837case Keys.OemMinus: 2838case Keys.Subtract: 2846bool expand = keyCode is Keys.Add or Keys.Oemplus; 2852case Keys.D8: 2855goto case Keys.Multiply; 2859case Keys.Multiply: 2865case Keys.Prior: // PAGE_UP 2866case Keys.Next: // PAGE_DOWN 2868bool next = keyCode == Keys.Next; 2897case Keys.Insert: 2901goto case Keys.V; 2904goto case Keys.C; 2905case Keys.C: 2914case Keys.Delete: 2919goto case Keys.X; 2923case Keys.X: 2933case Keys.V: 2941case Keys.A: 2952if (e.KeyData == (Keys.C | Keys.Alt | Keys.Shift | Keys.Control)) 2962&& (keyCode == Keys.Up || keyCode == Keys.Down)) 3156if ((ModifierKeys & (Keys.Shift | Keys.Alt)) != 0 || MouseButtons != MouseButtons.None) 3840protected override bool ProcessDialogKey(Keys keyData) 3844Keys keyCode = keyData & Keys.KeyCode; 3847case Keys.F4: 3861case Keys.Tab: 3863if (((keyData & Keys.Control) != 0) || 3864((keyData & Keys.Alt) != 0)) 3869bool forward = (keyData & Keys.Shift) == 0; 3931case Keys.Up: 3932case Keys.Down: 3933case Keys.Left: 3934case Keys.Right: 3936case Keys.Return: 5362if (_selectedGridEntry is not null && (ModifierKeys & Keys.Shift) == 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (8)
523protected override bool ProcessDialogKey(Keys keyData) 525if ((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == 0) 527switch (keyData & Keys.KeyCode) 529case Keys.Escape: 532case Keys.F4: 535case Keys.Return:
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.GridViewTextBox.cs (47)
100protected override bool IsInputKey(Keys keyData) 103switch (keyData & Keys.KeyCode) 105case Keys.Escape: 106case Keys.Tab: 107case Keys.F4: 108case Keys.F1: 109case Keys.Return: 121protected override bool IsInputChar(char keyChar) => (Keys)keyChar switch 124Keys.Tab or Keys.Return => false, 181protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 184switch (keyData & Keys.KeyCode) 186case Keys.Z: 187case Keys.C: 188case Keys.X: 189case Keys.V: 190if (((keyData & Keys.Control) != 0) && ((keyData & Keys.Shift) == 0) && ((keyData & Keys.Alt) == 0)) 197case Keys.A: 198if (((keyData & Keys.Control) != 0) && ((keyData & Keys.Shift) == 0) && ((keyData & Keys.Alt) == 0)) 206case Keys.Insert: 207if (((keyData & Keys.Alt) == 0)) 209if (((keyData & Keys.Control) != 0) ^ ((keyData & Keys.Shift) == 0)) 217case Keys.Delete: 218if (((keyData & Keys.Control) == 0) && ((keyData & Keys.Shift) != 0) && ((keyData & Keys.Alt) == 0)) 222else if (((keyData & Keys.Control) == 0) && ((keyData & Keys.Shift) == 0) && ((keyData & Keys.Alt) == 0)) 244protected override bool ProcessDialogKey(Keys keyData) 247if ((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == 0) 249switch (keyData & Keys.KeyCode) 251case Keys.Return: 259case Keys.Escape: 262case Keys.F4: 269if ((keyData & Keys.KeyCode) == Keys.Tab && ((keyData & (Keys.Control | Keys.Alt)) == 0)) 357if (PropertyGridView.EditTextBoxNeedsCommit || PropertyGridView.WantsTab(forward: (ModifierKeys & Keys.Shift) == 0))
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
2583protected override bool ProcessCmdKey(ref Message m, Keys keyData)
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (5)
87Keys modifierKeys = ModifierKeys; 111if ((modifierKeys & Keys.Control) == Keys.Control) 116if ((modifierKeys & Keys.Shift) == Keys.Shift)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
803if (_splitTarget is not null && e.KeyCode == Keys.Escape)
System\Windows\Forms\Controls\Splitter\Splitter.SplitterMessageFilter.cs (2)
26if (m.MsgInternal == PInvokeCore.WM_KEYDOWN && (Keys)(nint)m.WParamInternal == Keys.Escape)
System\Windows\Forms\Controls\TabControl\TabControl.cs (15)
1177protected override bool IsInputKey(Keys keyData) 1179if ((keyData & Keys.Alt) == Keys.Alt) 1184return (keyData & Keys.KeyCode) switch 1186Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true, 1390if (ke.KeyCode == Keys.Tab && (ke.KeyData & Keys.Control) != 0) 1392bool forward = (ke.KeyData & Keys.Shift) == 0; 1396if (ke.KeyCode == Keys.PageDown && (ke.KeyData & Keys.Control) != 0) 1401if (ke.KeyCode == Keys.PageUp && (ke.KeyData & Keys.Control) != 0)
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (28)
532protected override bool IsInputKey(Keys keyData) 534if ((keyData & Keys.KeyCode) == Keys.Return) 1163Delete(Keys.Delete, 0, _maskedTextProvider.Length); 1497private void Delete(Keys keyCode, int startPosition, int selectionLen) 1500Debug.Assert(keyCode is Keys.Delete or Keys.Back, $"Delete called with keyCode == {keyCode}"); 1510if (keyCode == Keys.Back) 1556if (keyCode == Keys.Delete) 1588if (keyCode == Keys.Back) // Case 3. 1848Keys keyCode = e.KeyCode; 1851if (keyCode is Keys.Return or Keys.Escape) 1858if (keyCode == Keys.Insert && e.Modifiers == Keys.None && _insertMode == InsertKeyMode.Default) 1880case Keys.H: // ctrl-h == Backspace == '\b' 1881keyCode = Keys.Back; // handle it below. 1893if (keyCode is Keys.Delete or Keys.Back) // Deletion keys. 1901case Keys.Shift: 1902if (keyCode == Keys.Delete) 1904keyCode = Keys.Back; 1909case Keys.Control: 1912if (keyCode == Keys.Delete) // delete to the end of the string. 2283Delete(Keys.Delete, selStart, selLength); 2413protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 2701Delete(Keys.Delete, selStart, selLength); 2823Delete(Keys.Delete, startEditPos, selectionLen);
System\Windows\Forms\Controls\TextBox\TextBox.cs (7)
517protected override bool IsInputKey(Keys keyData) 519if (Multiline && (keyData & Keys.Alt) == 0) 521switch (keyData & Keys.KeyCode) 523case Keys.Return: 670protected override bool ProcessCmdKey(ref Message m, Keys keyData) 673if (!returnValue && ShortcutsEnabled && (keyData == (Keys.Control | Keys.A)))
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (36)
161(int)Shortcut.CtrlE, (int)Shortcut.CtrlY, (int)Keys.Control + (int)Keys.Back, 172protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 183(int)keyData == (shortcutValue | (int)Keys.Shift)) 205if (!ReadOnly && (keyData == (Keys.Control | Keys.Back) || keyData == (Keys.Control | Keys.Shift | Keys.Back))) 1282protected bool ContainsNavigationKeyCode(Keys keyCode) => keyCode switch 1284Keys.Up or Keys.Down or Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End or Keys.Left or Keys.Right => true, 1331protected override bool IsInputKey(Keys keyData) 1333if ((keyData & Keys.Alt) != Keys.Alt) 1335switch (keyData & Keys.KeyCode) 1337case Keys.Tab: 1340return Multiline && _textBoxFlags[s_acceptsTab] && ((keyData & Keys.Control) == 0); 1341case Keys.Escape: 1348case Keys.Back: 1355case Keys.PageUp: 1356case Keys.PageDown: 1357case Keys.Home: 1358case Keys.End: 1413protected override bool ProcessDialogKey(Keys keyData) 1415Keys keyCode = keyData & Keys.KeyCode; 1417if (keyCode == Keys.Tab && AcceptsTab && (keyData & Keys.Control) != 0) 1420keyData &= ~Keys.Control;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (39)
51private Dictionary<Keys, ToolStripMenuItem>? _shortcuts; 1640internal Dictionary<Keys, ToolStripMenuItem> Shortcuts 1644_shortcuts ??= new Dictionary<Keys, ToolStripMenuItem>(1); 2047bool forward = LastKeyData == Keys.Tab || (TabStop && start is null && LastKeyData != Keys.Left); 2545protected override bool IsInputKey(Keys keyData) => 2636internal bool ProcessCmdKeyInternal(ref Message m, Keys keyData) 2669protected override bool ProcessCmdKey(ref Message m, Keys keyData) 2708(keyData & Keys.Control) == Keys.Control && (keyData & Keys.KeyCode) == Keys.Tab; 2713&& ToolStripManager.SelectNextToolStrip(this, forward: (keyData & Keys.Shift) == Keys.None)) 2732protected override bool ProcessDialogKey(Keys keyData) 2750bool hasModifiers = ((keyData & (Keys.Alt | Keys.Control)) != Keys.None); 2752Keys keyCode = keyData & Keys.KeyCode; 2755case Keys.Back: 2765case Keys.Tab: 2769retVal = ProcessTabKey((keyData & Keys.Shift) == Keys.None); 2773case Keys.Left: 2774case Keys.Right: 2775case Keys.Up: 2776case Keys.Down: 2779case Keys.Home: 2783case Keys.End: 2787case Keys.Escape: // escape and menu key should restore focus 2842if (!inMenuMode && ModifierKeys == Keys.Alt) 3031internal virtual bool ProcessArrowKey(Keys keyCode) 3038case Keys.Left: 3039case Keys.Right: 3040retVal = ProcessLeftRightArrowKey(keyCode == Keys.Right); 3042case Keys.Up: 3043case Keys.Down: 3047if (keyCode == Keys.Down)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (2)
235protected internal override bool ProcessDialogKey(Keys keyData) 241if (keyData == Keys.Space && SupportsSpaceKey && CheckOnClick && Enabled && !IsOnDropDown)
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.cs (6)
50protected override bool IsInputKey(Keys keyData) 52if ((keyData & Keys.Alt) == Keys.Alt) 54switch (keyData & Keys.KeyCode) 56case Keys.Down: 57case Keys.Up:
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (2)
814protected internal override bool ProcessCmdKey(ref Message m, Keys keyData) => false; 819protected internal override bool ProcessDialogKey(Keys keyData) => false;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (7)
1284internal override bool ProcessArrowKey(Keys keyCode) 1288if (keyCode is Keys.Left or Keys.Right) 1290bool forward = keyCode == Keys.Right; 1348protected override bool ProcessDialogKey(Keys keyData) 1371if ((keyData & Keys.KeyCode) == Keys.Escape)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
131if ((Control.ModifierKeys != Keys.Alt) && 152if ((Control.ModifierKeys != Keys.Alt) &&
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (16)
554protected internal override bool ProcessCmdKey(ref Message m, Keys keyData) 564protected internal override bool ProcessDialogKey(Keys keyData) 566Keys keyCode = keyData & Keys.KeyCode; 573if (isTopLevel && (keyCode == Keys.Down || keyCode == Keys.Up || keyCode == Keys.Enter || (SupportsSpaceKey && keyCode == Keys.Space))) 589bool forward = ((keyCode == Keys.Enter) || (SupportsSpaceKey && keyCode == Keys.Space)); 590forward = (forward || (menusCascadeRight && keyCode == Keys.Left) || (!menusCascadeRight && keyCode == Keys.Right)); 608if (isTopLevel && (keyCode == Keys.Down || keyCode == Keys.Up)) 617bool backward = ((menusCascadeRight && keyCode == Keys.Right) || (!menusCascadeRight && keyCode == Keys.Left));
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (1)
106return (Control.MouseButtons == MouseButtons.Left) && (Control.ModifierKeys == Keys.None);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (7)
2060if (Control.ModifierKeys == Keys.Alt) 2408protected internal virtual bool IsInputKey(Keys keyData) => false; 2474if (PInvoke.GetKeyState((int)Keys.LButton) < 0) 3048protected internal virtual bool ProcessDialogKey(Keys keyData) 3050if (keyData == Keys.Enter || (_state[s_stateSupportsSpaceKey] && keyData == Keys.Space)) 3069protected internal virtual bool ProcessCmdKey(ref Message m, Keys keyData) => false;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (27)
653public static bool IsValidShortcut(Keys shortcut) 656Keys keyCode = shortcut & Keys.KeyCode; 657Keys modifiers = shortcut & Keys.Modifiers; 659if (shortcut == Keys.None) 663else if (keyCode is Keys.Delete or Keys.Insert) 667else if ((int)keyCode is >= ((int)Keys.F1) and <= ((int)Keys.F24)) 672else if ((keyCode != Keys.None) && (modifiers != Keys.None)) 676case Keys.Menu: 677case Keys.ControlKey: 678case Keys.ShiftKey: 682if (modifiers == Keys.Shift) 696internal static bool IsMenuKey(Keys keyData) 697=> (keyData & Keys.KeyCode) is Keys.Menu or Keys.F10; 699public static bool IsShortcutDefined(Keys shortcut) 716internal static bool ProcessCmdKey(ref Message m, Keys keyData) 741internal static bool ProcessShortcut(ref Message m, Keys shortcut) 878Keys keyData = (Keys)(nint)m.LParamInternal; 921if (PInvoke.GetKeyState((int)Keys.ShiftKey) < 0 && (keyData == Keys.None))
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (2)
256Keys keyData = (Keys)(nint)m.WParamInternal;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (19)
101public ToolStripMenuItem(string? text, Image? image, EventHandler? onClick, Keys shortcutKeys) 202TypeDescriptor.RegisterType<Keys>(); 355[DefaultValue(Keys.None)] 357public Keys ShortcutKeys 359get => Properties.GetValueOrDefault(s_propShortcutKeys, Keys.None); 362if ((value != Keys.None) && !ToolStripManager.IsValidShortcut(value)) 365throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(Keys)); 368Keys originalShortcut = ShortcutKeys; 379if (originalShortcut != Keys.None) 395Properties.AddOrRemoveValue(s_propShortcutKeys, value, defaultValue: Keys.None); 569Keys shortcut = ShortcutKeys; 570if (shortcut != Keys.None && _lastOwner.Shortcuts.ContainsKey(shortcut)) 917Keys shortcut = ShortcutKeys; 918if (shortcut != Keys.None) 1032protected internal override bool ProcessCmdKey(ref Message m, Keys keyData) 1089internal static string? ShortcutToText(Keys shortcutKeys, string? shortcutKeyDisplayString) 1096if (shortcutKeys == Keys.None) 1103return TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString(context: null, CultureInfo.CurrentUICulture, shortcutKeys); 1108return TypeDescriptor.GetConverterFromRegisteredType(typeof(Keys)).ConvertToString(context: null, CultureInfo.CurrentUICulture, shortcutKeys);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (3)
366protected internal override bool ProcessDialogKey(Keys keyData) 368if (Enabled && (keyData == Keys.Enter || (SupportsSpaceKey && keyData == Keys.Space)))
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (10)
838protected override bool IsInputKey(Keys keyData) 840if ((keyData & Keys.Alt) == Keys.Alt) 845return (keyData & Keys.KeyCode) switch 847Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true, 923if ((ModifierKeys & (Keys.Shift | Keys.Alt)) != 0 || MouseButtons != MouseButtons.None)
System\Windows\Forms\Controls\TreeView\TreeView.cs (13)
1802protected override bool IsInputKey(Keys keyData) 1807if (_editNode is not null && (keyData & Keys.Alt) == 0) 1809switch (keyData & Keys.KeyCode) 1811case Keys.Return: 1812case Keys.Escape: 1813case Keys.PageUp: 1814case Keys.PageDown: 1815case Keys.Home: 1816case Keys.End: 2251if (CheckBoxes && (e.KeyData & Keys.KeyCode) == Keys.Space) 2281if ((e.KeyData & Keys.KeyCode) == Keys.Space)
System\Windows\Forms\Controls\Unsupported\ContextMenu\ContextMenu.cs (1)
55protected internal virtual bool ProcessCmdKey(ref Message msg, Keys keyData, Control control) => throw null;
System\Windows\Forms\Controls\Unsupported\ContextMenu\Menu.cs (1)
79protected internal virtual bool ProcessCmdKey(ref Message msg, Keys keyData) => throw null;
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGrid.cs (1)
566protected bool ProcessTabKey(Keys keyData) => throw null;
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (6)
421if (InterceptArrowKeys && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) && !Spinning) 434if (InterceptArrowKeys && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)) 473else if ((ModifierKeys & (Keys.Control | Keys.Alt)) != 0)
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (5)
596if (e.KeyData == Keys.Up) 603else if (e.KeyData == Keys.Down) 611if (e.KeyCode == Keys.Return && UserEdit) 731if ((ModifierKeys & (Keys.Shift | Keys.Alt)) != 0 || MouseButtons != MouseButtons.None)
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
214protected override bool ProcessDialogKey(Keys keyData) =>
System\Windows\Forms\DataBinding\BindingNavigator.cs (2)
741case Keys.Enter: 744case Keys.Escape:
System\Windows\Forms\Form.cs (9)
4702protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 4732protected override bool ProcessDialogKey(Keys keyData) 4734if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 4736Keys keyCode = keyData & Keys.KeyCode; 4740case Keys.Return: 4753case Keys.Escape:
System\Windows\Forms\Input\KeyEventArgs.cs (15)
17public KeyEventArgs(Keys keyData) 25public virtual bool Alt => (KeyData & Keys.Alt) == Keys.Alt; 30public bool Control => (KeyData & Keys.Control) == Keys.Control; 41public Keys KeyCode 45Keys keyGenerated = KeyData & Keys.KeyCode; 50return Keys.None; 61public int KeyValue => (int)(KeyData & Keys.KeyCode); 67public Keys KeyData { get; } 74public Keys Modifiers => KeyData & Keys.Modifiers; 79public virtual bool Shift => (KeyData & Keys.Shift) == Keys.Shift;
System\Windows\Forms\Input\KeysConverter.cs (74)
12/// Provides a type converter to convert <see cref="Keys"/> objects to and from various 18private Dictionary<CultureInfo, Dictionary<string, Keys>>? _cultureToKeyName; 38Dictionary<string, Keys> localizedNames = new(34); 40AddLocalizedKey(nameof(SR.toStringEnter), Keys.Return); 41AddKey("F12", Keys.F12); 42AddKey("F11", Keys.F11); 43AddKey("F10", Keys.F10); 44AddLocalizedKey(nameof(SR.toStringEnd), Keys.End); 45AddLocalizedKey(nameof(SR.toStringControl), Keys.Control); 46AddKey("F8", Keys.F8); 47AddKey("F9", Keys.F9); 48AddLocalizedKey(nameof(SR.toStringAlt), Keys.Alt); 49AddKey("F4", Keys.F4); 50AddKey("F5", Keys.F5); 51AddKey("F6", Keys.F6); 52AddKey("F7", Keys.F7); 53AddKey("F1", Keys.F1); 54AddKey("F2", Keys.F2); 55AddKey("F3", Keys.F3); 56AddLocalizedKey(nameof(SR.toStringPageDown), Keys.Next); 57AddLocalizedKey(nameof(SR.toStringInsert), Keys.Insert); 58AddLocalizedKey(nameof(SR.toStringHome), Keys.Home); 59AddLocalizedKey(nameof(SR.toStringDelete), Keys.Delete); 60AddLocalizedKey(nameof(SR.toStringShift), Keys.Shift); 61AddLocalizedKey(nameof(SR.toStringPageUp), Keys.Prior); 62AddLocalizedKey(nameof(SR.toStringBack), Keys.Back); 63AddLocalizedKey(nameof(SR.toStringNone), Keys.None); 68AddKey("0", Keys.D0); 69AddKey("1", Keys.D1); 70AddKey("2", Keys.D2); 71AddKey("3", Keys.D3); 72AddKey("4", Keys.D4); 73AddKey("5", Keys.D5); 74AddKey("6", Keys.D6); 75AddKey("7", Keys.D7); 76AddKey("8", Keys.D8); 77AddKey("9", Keys.D9); 82void AddKey(string key, Keys value) 88void AddLocalizedKey(string resourceName, Keys value) 97/// This dictionary maps culture to a dictionary of localized names and their corresponding <see cref="Keys"/> value. 99private Dictionary<CultureInfo, Dictionary<string, Keys>> CultureToKeyName 159Dictionary<string, Keys> keyNames = GetKeyNames(culture); 165Keys key = 0; 170if (!keyNames.TryGetValue(token, out Keys currentKey)) 174currentKey = (Keys)Enum.Parse(typeof(Keys), token); 177if ((currentKey & Keys.KeyCode) != 0) 206return Enum.ToObject(typeof(Keys), finalValue); 223if (value is not Keys and not int) 229? GetTermsString((Keys)value) 231? GetTermKeys((Keys)value) 234Enum[] GetTermKeys(Keys key) 237Keys modifiers = key & Keys.Modifiers; 238Dictionary<string, Keys> keyNames = GetKeyNames(culture); 241if (key != Keys.None) 247Keys keyValue = keyNames[keyString]; 248if (keyValue != Keys.None && modifiers.HasFlag(keyValue)) 257Keys keyOnly = key & Keys.KeyCode; 262Keys keyValue = keyNames[keyString]; 282string GetTermsString(Keys key) 285Keys modifiers = key & Keys.Modifiers; 286Dictionary<string, Keys> keyNames = GetKeyNames(culture); 289if (key != Keys.None) 295Keys keyValue = keyNames[keyString]; 296if (keyValue != Keys.None && modifiers.HasFlag(keyValue)) 305Keys keyOnly = key & Keys.KeyCode; 310Keys keyValue = keyNames[keyString]; 344private Dictionary<string, Keys> GetKeyNames(CultureInfo? culture) 365keys.Remove(Keys.None); 368Keys[] values = [.. keys];
System\Windows\Forms\Input\PreviewKeyDownEventArgs.cs (15)
11public PreviewKeyDownEventArgs(Keys keyData) 20public Keys KeyData { get; } 22public bool Alt => (KeyData & Keys.Alt) == Keys.Alt; 27public bool Control => (KeyData & Keys.Control) == Keys.Control; 33public Keys KeyCode 37Keys keyGenerated = KeyData & Keys.KeyCode; 40return Keys.None; 51public int KeyValue => (int)(KeyData & Keys.KeyCode); 58public Keys Modifiers => KeyData & Keys.Modifiers; 63public bool Shift => (KeyData & Keys.Shift) == Keys.Shift;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (16)
1185protected override bool ProcessDialogKey(Keys keyData) 1188if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 1190Keys keyCode = keyData & Keys.KeyCode; 1193case Keys.Tab: 1194if (ProcessTabKey((keyData & Keys.Shift) == Keys.None)) 1200case Keys.Left: 1201case Keys.Right: 1202case Keys.Up: 1203case Keys.Down: 1204if (ProcessArrowKey(keyCode is Keys.Right or Keys.Down)) 1216protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
System\Windows\Forms\Layout\Containers\SplitContainer.cs (28)
935if (e.KeyData == Keys.Escape && _splitBegin) 944&& (e.KeyData == Keys.Right || e.KeyData == Keys.Down || e.KeyData == Keys.Left || e.KeyData == Keys.Up)) 952if (_splitterFocused && (e.KeyData == Keys.Left || e.KeyData == Keys.Up)) 959if (_splitterFocused && (e.KeyData == Keys.Right || e.KeyData == Keys.Down)) 1011&& (e.KeyData == Keys.Right || e.KeyData == Keys.Down || e.KeyData == Keys.Left || e.KeyData == Keys.Up)) 2297protected override bool ProcessDialogKey(Keys keyData) 2299if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 2301Keys keyCode = keyData & Keys.KeyCode; 2304case Keys.Tab: 2305if (ProcessTabKey((keyData & Keys.Shift) == Keys.None)) 2311case Keys.Left: 2312case Keys.Right: 2313case Keys.Up: 2314case Keys.Down: 2317if (ProcessArrowKey(keyCode is Keys.Right or 2318Keys.Down))
System\Windows\Forms\Layout\Containers\SplitContainer.SplitContainerMessageFilter.cs (2)
24if ((m.MsgInternal == PInvokeCore.WM_KEYDOWN && (Keys)(nint)m.WParamInternal == Keys.Escape)
System\Windows\Forms\MDI\MDIControlStrip.cs (2)
70_system.ShortcutKeys = Keys.Alt | Keys.OemMinus;
System\Windows\Forms\MDI\MdiControlStrip.SystemMenuItem.cs (1)
16protected internal override bool ProcessCmdKey(ref Message m, Keys keyData)
System\Windows\Forms\Printing\PrintPreviewControl.cs (19)
904Keys keyData = (Keys)(nint)msg.WParamInternal | ModifierKeys; 912switch (keyData & Keys.KeyCode) 914case Keys.PageUp: 915if ((keyData & Keys.Modifiers) == Keys.Control) 947case Keys.PageDown: 948if ((keyData & Keys.Modifiers) == Keys.Control) 981case Keys.Home: 982if ((keyData & Keys.Modifiers) == Keys.Control) 988case Keys.End: 989if (_pageInfo is not null && (keyData & Keys.Modifiers) == Keys.Control) 996case Keys.Up: 1014case Keys.Down: 1034case Keys.Left: 1052case Keys.Right:
System\Windows\Forms\Printing\PrintPreviewDialog.cs (17)
1005protected override bool ProcessDialogKey(Keys keyData) 1007Keys keyCode = keyData & Keys.KeyCode; 1008if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 1012case Keys.Left: 1013case Keys.Right: 1014case Keys.Up: 1015case Keys.Down: 1019else if ((keyData & Keys.Control) == Keys.Control) 1023Keys.D1 => PerformPageToolStripButtonClick(_onePageToolStripButton), 1024Keys.D2 => PerformPageToolStripButtonClick(_twoPagesToolStripButton), 1025Keys.D3 => PerformPageToolStripButtonClick(_threePagesToolStripButton), 1026Keys.D4 => PerformPageToolStripButtonClick(_fourPagesToolStripButton), 1027Keys.D5 => PerformPageToolStripButtonClick(_sixPagesToolStripButton),
System\Windows\Forms\Printing\PrintPreviewDialog.PrintPreviewDialogToolStripButton.cs (3)
13protected internal override bool ProcessDialogKey(Keys keyData) 15if (keyData == Keys.Enter || (SupportsSpaceKey && keyData == Keys.Space))
System\Windows\Forms\SendKeys\SendKeys.cs (80)
24new("ENTER", Keys.Return), 25new("TAB", Keys.Tab), 26new("ESC", Keys.Escape), 27new("ESCAPE", Keys.Escape), 28new("HOME", Keys.Home), 29new("END", Keys.End), 30new("LEFT", Keys.Left), 31new("RIGHT", Keys.Right), 32new("UP", Keys.Up), 33new("DOWN", Keys.Down), 34new("PGUP", Keys.Prior), 35new("PGDN", Keys.Next), 36new("NUMLOCK", Keys.NumLock), 37new("SCROLLLOCK", Keys.Scroll), 38new("PRTSC", Keys.PrintScreen), 39new("BREAK", Keys.Cancel), 40new("BACKSPACE", Keys.Back), 41new("BKSP", Keys.Back), 42new("BS", Keys.Back), 43new("CLEAR", Keys.Clear), 44new("CAPSLOCK", Keys.Capital), 45new("INS", Keys.Insert), 46new("INSERT", Keys.Insert), 47new("DEL", Keys.Delete), 48new("DELETE", Keys.Delete), 49new("HELP", Keys.Help), 50new("F1", Keys.F1), 51new("F2", Keys.F2), 52new("F3", Keys.F3), 53new("F4", Keys.F4), 54new("F5", Keys.F5), 55new("F6", Keys.F6), 56new("F7", Keys.F7), 57new("F8", Keys.F8), 58new("F9", Keys.F9), 59new("F10", Keys.F10), 60new("F11", Keys.F11), 61new("F12", Keys.F12), 62new("F13", Keys.F13), 63new("F14", Keys.F14), 64new("F15", Keys.F15), 65new("F16", Keys.F16), 66new("MULTIPLY", Keys.Multiply), 67new("ADD", Keys.Add), 68new("SUBTRACT", Keys.Subtract), 69new("DIVIDE", Keys.Divide), 70new("+", Keys.Add), 71new("%", (Keys.D5 | Keys.Shift)), 72new("^", (Keys.D6 | Keys.Shift)), 140AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.ShiftKey, startNewChar, hwnd)); 147AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.ControlKey, startNewChar, hwnd)); 154AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.Menu, startNewChar, hwnd)); 199AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)Keys.ShiftKey, false, hwnd)); 205AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)Keys.ControlKey, false, hwnd)); 211AddEvent(new SKEvent(PInvokeCore.WM_SYSKEYUP, (int)Keys.Menu, false, hwnd)); 339keystate[(int)Keys.Capital] = 0; 340keystate[(int)Keys.NumLock] = 0; 341keystate[(int)Keys.Scroll] = 0; 486if (haveKeys.HaveShift == 0 && (vk & (int)Keys.Shift) != 0) 488AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.ShiftKey, s_startNewChar, hwnd)); 493if (haveKeys.HaveCtrl == 0 && (vk & (int)Keys.Control) != 0) 495AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.ControlKey, s_startNewChar, hwnd)); 500if (haveKeys.HaveAlt == 0 && (vk & (int)Keys.Alt) != 0) 502AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.Menu, s_startNewChar, hwnd)); 529AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.ShiftKey, s_startNewChar, hwnd)); 540AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)Keys.ControlKey, s_startNewChar, hwnd)); 553(int)Keys.Menu, 603vk = (int)Keys.Return; 778if (skEvent.ParamL == (int)Keys.ShiftKey) 782else if (skEvent.ParamL == (int)Keys.ControlKey) 786else if (skEvent.ParamL == (int)Keys.Menu) 794AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)Keys.ShiftKey, false, default)); 798AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)Keys.ControlKey, false, default)); 802AddEvent(new SKEvent(PInvokeCore.WM_SYSKEYUP, (int)Keys.Menu, false, default)); 834case (int)Keys.CapsLock: 837case (int)Keys.NumLock: 840case (int)Keys.Scroll: 843case (int)Keys.KanaMode:
System\Windows\Forms\SendKeys\SendKeys.KeywordVk.cs (1)
16public KeywordVk(string keyword, Keys key)
System\Windows\Forms\SendKeys\SendKeys.SendKeysHookProc.cs (1)
30if (PInvoke.GetAsyncKeyState((int)Keys.Pause) != 0)
System\Windows\Forms\Shortcut.cs (340)
19CtrlA = Keys.Control + Keys.A, 24CtrlB = Keys.Control + Keys.B, 29CtrlC = Keys.Control + Keys.C, 34CtrlD = Keys.Control + Keys.D, 39CtrlE = Keys.Control + Keys.E, 44CtrlF = Keys.Control + Keys.F, 49CtrlG = Keys.Control + Keys.G, 54CtrlH = Keys.Control + Keys.H, 59CtrlI = Keys.Control + Keys.I, 64CtrlJ = Keys.Control + Keys.J, 69CtrlK = Keys.Control + Keys.K, 74CtrlL = Keys.Control + Keys.L, 79CtrlM = Keys.Control + Keys.M, 84CtrlN = Keys.Control + Keys.N, 89CtrlO = Keys.Control + Keys.O, 94CtrlP = Keys.Control + Keys.P, 99CtrlQ = Keys.Control + Keys.Q, 104CtrlR = Keys.Control + Keys.R, 109CtrlS = Keys.Control + Keys.S, 114CtrlT = Keys.Control + Keys.T, 119CtrlU = Keys.Control + Keys.U, 124CtrlV = Keys.Control + Keys.V, 129CtrlW = Keys.Control + Keys.W, 134CtrlX = Keys.Control + Keys.X, 139CtrlY = Keys.Control + Keys.Y, 144CtrlZ = Keys.Control + Keys.Z, 149CtrlShiftA = Keys.Control + Keys.Shift + Keys.A, 154CtrlShiftB = Keys.Control + Keys.Shift + Keys.B, 159CtrlShiftC = Keys.Control + Keys.Shift + Keys.C, 164CtrlShiftD = Keys.Control + Keys.Shift + Keys.D, 169CtrlShiftE = Keys.Control + Keys.Shift + Keys.E, 174CtrlShiftF = Keys.Control + Keys.Shift + Keys.F, 179CtrlShiftG = Keys.Control + Keys.Shift + Keys.G, 184CtrlShiftH = Keys.Control + Keys.Shift + Keys.H, 189CtrlShiftI = Keys.Control + Keys.Shift + Keys.I, 194CtrlShiftJ = Keys.Control + Keys.Shift + Keys.J, 199CtrlShiftK = Keys.Control + Keys.Shift + Keys.K, 204CtrlShiftL = Keys.Control + Keys.Shift + Keys.L, 209CtrlShiftM = Keys.Control + Keys.Shift + Keys.M, 214CtrlShiftN = Keys.Control + Keys.Shift + Keys.N, 219CtrlShiftO = Keys.Control + Keys.Shift + Keys.O, 224CtrlShiftP = Keys.Control + Keys.Shift + Keys.P, 229CtrlShiftQ = Keys.Control + Keys.Shift + Keys.Q, 234CtrlShiftR = Keys.Control + Keys.Shift + Keys.R, 239CtrlShiftS = Keys.Control + Keys.Shift + Keys.S, 244CtrlShiftT = Keys.Control + Keys.Shift + Keys.T, 249CtrlShiftU = Keys.Control + Keys.Shift + Keys.U, 254CtrlShiftV = Keys.Control + Keys.Shift + Keys.V, 259CtrlShiftW = Keys.Control + Keys.Shift + Keys.W, 264CtrlShiftX = Keys.Control + Keys.Shift + Keys.X, 269CtrlShiftY = Keys.Control + Keys.Shift + Keys.Y, 274CtrlShiftZ = Keys.Control + Keys.Shift + Keys.Z, 279F1 = Keys.F1, 284F2 = Keys.F2, 289F3 = Keys.F3, 294F4 = Keys.F4, 299F5 = Keys.F5, 304F6 = Keys.F6, 309F7 = Keys.F7, 310F8 = Keys.F8, 315F9 = Keys.F9, 320F10 = Keys.F10, 325F11 = Keys.F11, 330F12 = Keys.F12, 335ShiftF1 = Keys.Shift + Keys.F1, 340ShiftF2 = Keys.Shift + Keys.F2, 345ShiftF3 = Keys.Shift + Keys.F3, 350ShiftF4 = Keys.Shift + Keys.F4, 355ShiftF5 = Keys.Shift + Keys.F5, 360ShiftF6 = Keys.Shift + Keys.F6, 365ShiftF7 = Keys.Shift + Keys.F7, 370ShiftF8 = Keys.Shift + Keys.F8, 375ShiftF9 = Keys.Shift + Keys.F9, 380ShiftF10 = Keys.Shift + Keys.F10, 385ShiftF11 = Keys.Shift + Keys.F11, 390ShiftF12 = Keys.Shift + Keys.F12, 395CtrlF1 = Keys.Control + Keys.F1, 400CtrlF2 = Keys.Control + Keys.F2, 405CtrlF3 = Keys.Control + Keys.F3, 410CtrlF4 = Keys.Control + Keys.F4, 415CtrlF5 = Keys.Control + Keys.F5, 420CtrlF6 = Keys.Control + Keys.F6, 425CtrlF7 = Keys.Control + Keys.F7, 430CtrlF8 = Keys.Control + Keys.F8, 435CtrlF9 = Keys.Control + Keys.F9, 440CtrlF10 = Keys.Control + Keys.F10, 445CtrlF11 = Keys.Control + Keys.F11, 450CtrlF12 = Keys.Control + Keys.F12, 455CtrlShiftF1 = Keys.Control + Keys.Shift + Keys.F1, 460CtrlShiftF2 = Keys.Control + Keys.Shift + Keys.F2, 465CtrlShiftF3 = Keys.Control + Keys.Shift + Keys.F3, 470CtrlShiftF4 = Keys.Control + Keys.Shift + Keys.F4, 475CtrlShiftF5 = Keys.Control + Keys.Shift + Keys.F5, 480CtrlShiftF6 = Keys.Control + Keys.Shift + Keys.F6, 485CtrlShiftF7 = Keys.Control + Keys.Shift + Keys.F7, 490CtrlShiftF8 = Keys.Control + Keys.Shift + Keys.F8, 495CtrlShiftF9 = Keys.Control + Keys.Shift + Keys.F9, 500CtrlShiftF10 = Keys.Control + Keys.Shift + Keys.F10, 505CtrlShiftF11 = Keys.Control + Keys.Shift + Keys.F11, 510CtrlShiftF12 = Keys.Control + Keys.Shift + Keys.F12, 515Ins = Keys.Insert, 520CtrlIns = Keys.Control + Keys.Insert, 525ShiftIns = Keys.Shift + Keys.Insert, 530Del = Keys.Delete, 535CtrlDel = Keys.Control + Keys.Delete, 540ShiftDel = Keys.Shift + Keys.Delete, 545AltRightArrow = Keys.Alt + Keys.Right, 550AltLeftArrow = Keys.Alt + Keys.Left, 555AltUpArrow = Keys.Alt + Keys.Up, 560AltDownArrow = Keys.Alt + Keys.Down, 565AltBksp = Keys.Alt + Keys.Back, 570AltF1 = Keys.Alt + Keys.F1, 575AltF2 = Keys.Alt + Keys.F2, 580AltF3 = Keys.Alt + Keys.F3, 585AltF4 = Keys.Alt + Keys.F4, 590AltF5 = Keys.Alt + Keys.F5, 595AltF6 = Keys.Alt + Keys.F6, 600AltF7 = Keys.Alt + Keys.F7, 605AltF8 = Keys.Alt + Keys.F8, 610AltF9 = Keys.Alt + Keys.F9, 615AltF10 = Keys.Alt + Keys.F10, 620AltF11 = Keys.Alt + Keys.F11, 625AltF12 = Keys.Alt + Keys.F12, 630Alt0 = Keys.Alt + Keys.D0, 635Alt1 = Keys.Alt + Keys.D1, 640Alt2 = Keys.Alt + Keys.D2, 645Alt3 = Keys.Alt + Keys.D3, 650Alt4 = Keys.Alt + Keys.D4, 655Alt5 = Keys.Alt + Keys.D5, 660Alt6 = Keys.Alt + Keys.D6, 665Alt7 = Keys.Alt + Keys.D7, 670Alt8 = Keys.Alt + Keys.D8, 675Alt9 = Keys.Alt + Keys.D9, 680Ctrl0 = Keys.Control + Keys.D0, 685Ctrl1 = Keys.Control + Keys.D1, 690Ctrl2 = Keys.Control + Keys.D2, 695Ctrl3 = Keys.Control + Keys.D3, 700Ctrl4 = Keys.Control + Keys.D4, 705Ctrl5 = Keys.Control + Keys.D5, 710Ctrl6 = Keys.Control + Keys.D6, 715Ctrl7 = Keys.Control + Keys.D7, 720Ctrl8 = Keys.Control + Keys.D8, 725Ctrl9 = Keys.Control + Keys.D9, 730CtrlShift0 = Keys.Control + Keys.Shift + Keys.D0, 735CtrlShift1 = Keys.Control + Keys.Shift + Keys.D1, 740CtrlShift2 = Keys.Control + Keys.Shift + Keys.D2, 745CtrlShift3 = Keys.Control + Keys.Shift + Keys.D3, 750CtrlShift4 = Keys.Control + Keys.Shift + Keys.D4, 755CtrlShift5 = Keys.Control + Keys.Shift + Keys.D5, 760CtrlShift6 = Keys.Control + Keys.Shift + Keys.D6, 765CtrlShift7 = Keys.Control + Keys.Shift + Keys.D7, 770CtrlShift8 = Keys.Control + Keys.Shift + Keys.D8, 775CtrlShift9 = Keys.Control + Keys.Shift + Keys.D9,
System.Windows.Forms.Design (391)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (2)
650case Keys.Delete: 653case Keys.Insert:
System\ComponentModel\Design\CollectionEditor.FilterListBox.cs (2)
77if ((ModifierKeys & (Keys.Control | Keys.Alt)) != 0)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (3)
70protected override bool IsInputKey(Keys keyData) 72if (keyData is Keys.Down && _showSplit) 96if (kevent.KeyCode is Keys.Down && _showSplit)
System\ComponentModel\Design\DateTimeEditor.DateTimeUI.cs (3)
48case Keys.Enter: 88protected override bool IsInputKey(Keys keyData) => keyData switch 90Keys.Enter => true,
System\ComponentModel\Design\DesignerActionPanel.cs (1)
525protected override bool ProcessDialogKey(Keys keyData)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (11)
197if (e.KeyData == Keys.Enter) 301protected internal override bool ProcessDialogKey(Keys keyData) 309if (keyData is (Keys.Alt | Keys.Down) or (Keys.Alt | Keys.Up) or Keys.F4) 324else if ((keyData & Keys.Alt) == Keys.Alt) 457protected override bool ProcessDialogKey(Keys keyData) 459if (keyData == Keys.Escape)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (6)
125protected override bool ProcessDialogKey(Keys keyData) 127if (keyData is (Keys.Alt | Keys.Down) or (Keys.Alt | Keys.Up) or Keys.F4)
System\ComponentModel\Design\DesignerActionPanel.Line.cs (1)
49protected internal virtual bool ProcessDialogKey(Keys keyData) => false;
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (6)
97protected override bool ProcessDialogKey(Keys keyData) 99if ((keyData & Keys.Control) == Keys.Control) 101Keys keyCode = keyData & Keys.KeyCode; 104case Keys.Tab:
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (6)
189if (e.KeyCode == Keys.Down) 219if (e.KeyCode == Keys.Up) 263if (e.KeyCode == Keys.Enter) 339protected override bool IsInputKey(Keys keyData) 341if (keyData is Keys.Down or Keys.Up)
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (2)
251protected override bool ProcessDialogKey(Keys keyData) 256if (keyData == Keys.Enter)
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (12)
64protected override bool IsInputKey(Keys keyData) 66if ((keyData & Keys.KeyCode) == Keys.Return && Multiline && (keyData & Keys.Alt) == 0) 74protected override bool ProcessDialogKey(Keys keyData) 76if ((keyData & (Keys.Shift | Keys.Alt)) == 0) 78switch (keyData & Keys.KeyCode) 80case Keys.Escape: 81if ((keyData & Keys.Control) == 0) 106if (e is { Control: true, KeyCode: Keys.Return, Modifiers: Keys.Control })
System\ComponentModel\Design\ObjectSelectorEditor.Selector.cs (3)
94Keys key = e.KeyCode; 97case Keys.Return: 105case Keys.Escape:
System\ComponentModel\Design\SelectionService.cs (3)
373fToggle = (Control.ModifierKeys & (Keys.Control | Keys.Shift)) > 0; 374fAdd |= Control.ModifierKeys == Keys.Shift;
System\Drawing\Design\ColorEditor.ColorPalette.cs (15)
228protected override bool IsInputKey(Keys keyData) => keyData switch 230Keys.Left or Keys.Right or Keys.Up or Keys.Down or Keys.Enter => true, 232Keys.F2 => false, 275case Keys.Enter: 280case Keys.Space: 284case Keys.Left: 287case Keys.Right: 290case Keys.Up: 293case Keys.Down: 420protected override bool ProcessDialogKey(Keys keyData) 422if (keyData == Keys.F2)
System\Drawing\Design\ColorEditor.ColorUI.ColorEditorListBox.cs (2)
14protected override bool IsInputKey(Keys keyData) 18Keys.Return => true,
System\Drawing\Design\ColorEditor.ColorUI.cs (7)
284if (ke.KeyCode == Keys.Return) 331protected override bool ProcessDialogKey(Keys keyData) 336if ((keyData & Keys.Alt) == 0 337&& (keyData & Keys.Control) == 0 338&& (keyData & Keys.KeyCode) == Keys.Tab) 341bool forward = (keyData & Keys.Shift) == 0;
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (2)
429protected override RadioButton ProcessTabKey(Keys keyData) 431int nextTabIndex = CheckedControl.TabIndex + ((keyData & Keys.Shift) == 0 ? 1 : -1);
System\Drawing\Design\CursorEditor.CursorUI.cs (5)
98protected override bool ProcessDialogKey(Keys keyData) 100if ((keyData & Keys.KeyCode) == Keys.Return && (keyData & (Keys.Alt | Keys.Control)) == 0)
System\Drawing\Design\SelectionPanelBase.cs (12)
64Keys key = e.KeyCode; 69case Keys.Up: 72case Keys.Down: 75case Keys.Left: 78case Keys.Right: 81case Keys.Return: 97protected override bool ProcessDialogKey(Keys keyData) 99if ((keyData & Keys.KeyCode) == Keys.Tab && (keyData & (Keys.Alt | Keys.Control)) == 0) 114protected abstract RadioButton ProcessTabKey(Keys keyData);
System\Drawing\SelectionPanelBase.SelectionPanelRadioButton.cs (6)
19protected override bool IsInputKey(Keys keyData) => keyData switch 21Keys.Left or Keys.Right or Keys.Up or Keys.Down or Keys.Return => true,
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (14)
303protected override bool ProcessDialogKey(Keys keyData) 305if ((keyData & Keys.KeyCode) == Keys.Return && (keyData & (Keys.Alt | Keys.Control)) == 0) 311if ((keyData & Keys.KeyCode) == Keys.Escape && (keyData & (Keys.Alt | Keys.Control)) == 0) 317if ((keyData & Keys.KeyCode) == Keys.Tab && (keyData & (Keys.Alt | Keys.Control)) == 0) 323i += (keyData & Keys.Shift) == 0 ? 1 : -1;
System\Windows\Forms\Design\Behavior\Behavior.cs (1)
330e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
613bool altKeyPressed = Control.ModifierKeys == Keys.Alt;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (1)
464bool altKeyPressed = Control.ModifierKeys == Keys.Alt;
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (1)
294bool altKeyPressed = Control.ModifierKeys == Keys.Alt;
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (1)
311? Control.ModifierKeys == Keys.Control
System\Windows\Forms\Design\ComponentTray.cs (1)
2147_ctrlSelect = PInvoke.GetKeyState((int)Keys.ControlKey) != 0;
System\Windows\Forms\Design\ControlDesigner.cs (2)
1322_ctrlSelect = (Control.ModifierKeys & Keys.Control) != 0; 1347bool shiftSelect = (Control.ModifierKeys & Keys.Shift) != 0;
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (4)
762protected override bool ProcessDialogKey(Keys keyData) 764if ((keyData & Keys.Modifiers) == 0) 766switch (keyData & Keys.KeyCode) 768case Keys.Enter:
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (4)
267protected override bool ProcessDialogKey(Keys keyData) 269if ((keyData & Keys.Modifiers) == 0 && (keyData & Keys.KeyCode) == Keys.Escape)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (3)
1034if ((e.Modifiers) == 0 && e.KeyCode == Keys.F4) 1043Keys modifierKeys = ModifierKeys; 1047if ((modifierKeys & Keys.Control) != 0)
System\Windows\Forms\Design\DesignBindingPicker.cs (5)
1871protected override bool IsInputKey(Keys key) 1873return (key == Keys.Return) || base.IsInputKey(key); 2086if (e.KeyData == Keys.Return && SelectedNode is not null) 2095protected override bool IsInputKey(Keys key) 2097return key == Keys.Return || base.IsInputKey(key);
System\Windows\Forms\Design\DesignerFrame.cs (11)
154protected override bool ProcessDialogKey(Keys keyData) 188Keys keycode = (Keys)(m.WParamInternal & 0xFFFF); 191Keys.Up => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_VSCROLL), 192Keys.Down => (SCROLLBAR_COMMAND.SB_LINEDOWN, (MessageId)PInvokeCore.WM_VSCROLL), 193Keys.PageUp => (SCROLLBAR_COMMAND.SB_PAGEUP, (MessageId)PInvokeCore.WM_VSCROLL), 194Keys.PageDown => (SCROLLBAR_COMMAND.SB_PAGEDOWN, (MessageId)PInvokeCore.WM_VSCROLL), 195Keys.Home => (SCROLLBAR_COMMAND.SB_TOP, (MessageId)PInvokeCore.WM_VSCROLL), 196Keys.End => (SCROLLBAR_COMMAND.SB_BOTTOM, (MessageId)PInvokeCore.WM_VSCROLL), 197Keys.Left => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_HSCROLL), 198Keys.Right => (SCROLLBAR_COMMAND.SB_LINEDOWN, (MessageId)PInvokeCore.WM_HSCROLL),
System\Windows\Forms\Design\DockEditor.DockUI.cs (2)
246protected override RadioButton ProcessTabKey(Keys keyData) 252i += (keyData & Keys.Shift) == 0 ? 1 : -1;
System\Windows\Forms\Design\FormatStringDialog.cs (5)
235protected override bool ProcessDialogKey(Keys keyData) 237if ((keyData & Keys.Modifiers) != 0) 242switch (keyData & Keys.KeyCode) 244case Keys.Enter: 249case Keys.Escape:
System\Windows\Forms\Design\MaskedTextBoxTextEditorDropDown.cs (2)
73protected override bool ProcessDialogKey(Keys keyData) 75if (keyData == Keys.Escape)
System\Windows\Forms\Design\NavigationalTableLayoutPanel.cs (3)
28protected override bool ProcessDialogKey(Keys keyData) 30bool down = keyData == Keys.Down; 31bool up = keyData == Keys.Up;
System\Windows\Forms\Design\NewItemsContextMenuStrip.cs (5)
71protected override bool ProcessDialogKey(Keys keyData) 73Keys keyCode = keyData & Keys.KeyCode; 76case Keys.Left: 77case Keys.Right:
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
1459de.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move; 1660de.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\PbrsForward.cs (2)
136if ((Control.ModifierKeys & (Keys.Control | Keys.Alt)) != 0)
System\Windows\Forms\Design\SelectionUIService.cs (2)
532_ctrlSelect = (ModifierKeys & Keys.Control) != Keys.None;
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (137)
19private static readonly Keys[] s_validKeys = 21Keys.A, Keys.B, Keys.C, Keys.D, Keys.D0, Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5, Keys.D6, Keys.D7, 22Keys.D8, Keys.D9, Keys.Delete, Keys.Down, Keys.E, Keys.End, Keys.F, Keys.F1, Keys.F10, Keys.F11, 23Keys.F12, Keys.F13, Keys.F14, Keys.F15, Keys.F16, Keys.F17, Keys.F18, Keys.F19, Keys.F2, Keys.F20, 24Keys.F21, Keys.F22, Keys.F23, Keys.F24, Keys.F3, Keys.F4, Keys.F5, Keys.F6, Keys.F7, Keys.F8, Keys.F9, 25Keys.G, Keys.H, Keys.I, Keys.Insert, Keys.J, Keys.K, Keys.L, Keys.Left, Keys.M, Keys.N, Keys.NumLock, 26Keys.NumPad0, Keys.NumPad1, Keys.NumPad2, Keys.NumPad3, Keys.NumPad4, Keys.NumPad5, Keys.NumPad6, 27Keys.NumPad7, Keys.NumPad8, Keys.NumPad9, Keys.O, Keys.OemBackslash, Keys.OemClear, Keys.OemCloseBrackets, 28Keys.Oemcomma, Keys.OemMinus, Keys.OemOpenBrackets, Keys.OemPeriod, Keys.OemPipe, Keys.Oemplus, 29Keys.OemQuestion, Keys.OemQuotes, Keys.OemSemicolon, Keys.Oemtilde, Keys.P, Keys.Pause, Keys.Q, Keys.R, 30Keys.Right, Keys.S, Keys.Space, Keys.T, Keys.Tab, Keys.U, Keys.Up, Keys.V, Keys.W, Keys.X, Keys.Y, Keys.Z 45private Keys _unknownKeyCode; 62private TypeConverter KeysConverter => _keysConverter ??= TypeDescriptor.GetConverter(typeof(Keys)); 71if (_currentValue is Keys currentKeys && (currentKeys & Keys.KeyCode) == 0) 73return Keys.None; 100if (_unknownKeyCode != Keys.None) 103_unknownKeyCode = Keys.None; 202foreach (Keys keyCode in s_validKeys) 238private static bool IsValidKey(Keys keyCode) 240Debug.Assert((keyCode & Keys.KeyCode) == keyCode); 257protected override bool ProcessDialogKey(Keys keyData) 259Keys keyCode = keyData & Keys.KeyCode; 260Keys keyModifiers = keyData & Keys.Modifiers; 264case Keys.Tab: 265if (keyModifiers == Keys.Shift && 274case Keys.Left: 275if ((keyModifiers & (Keys.Control | Keys.Alt)) == 0) 286case Keys.Right: 287if ((keyModifiers & (Keys.Control | Keys.Alt)) == 0) 304case Keys.Escape: 306(keyModifiers & (Keys.Control | Keys.Alt)) != 0 || 326Keys keys = value is Keys keys1 ? keys1 : Keys.None; 327_ctrlCheckBox.Checked = (keys & Keys.Control) != 0; 328_altCheckBox.Checked = (keys & Keys.Alt) != 0; 329_shiftCheckBox.Checked = (keys & Keys.Shift) != 0; 331Keys keyCode = keys & Keys.KeyCode; 332if (keyCode == Keys.None) 361Keys valueKeys = Keys.None; 364valueKeys |= Keys.Control; 369valueKeys |= Keys.Alt; 374valueKeys |= Keys.Shift; 377if (_unknownKeyCode != Keys.None && cmbKeySelectedIndex == 0) 383valueKeys |= s_validKeys[_unknownKeyCode == Keys.None ? cmbKeySelectedIndex : cmbKeySelectedIndex - 1];
System\Windows\Forms\Design\StandardMenuStripVerb.cs (41)
87Keys[][] menuItemShortcuts = 89[/*File*/Keys.None, /*New*/Keys.Control | Keys.N, /*Open*/Keys.Control | Keys.O, /*Separator*/ Keys.None, /*Save*/ Keys.Control | Keys.S, /*SaveAs*/Keys.None, Keys.None, /*Print*/ Keys.Control | Keys.P, /*PrintPreview*/ Keys.None, /*Separator*/Keys.None, /*Exit*/ Keys.None], 90[/*Edit*/Keys.None, /*Undo*/Keys.Control | Keys.Z, /*Redo*/Keys.Control | Keys.Y, /*Separator*/Keys.None, /*Cut*/ Keys.Control | Keys.X, /*Copy*/ Keys.Control | Keys.C, /*Paste*/Keys.Control | Keys.V, /*Separator*/ Keys.None, /*SelectAll*/Keys.None], 91[/*Tools*/Keys.None, /*Customize*/Keys.None, /*Options*/Keys.None], 92[/*Help*/Keys.None, /*Contents*/Keys.None, /*Index*/Keys.None, /*Search*/Keys.None, /*Separator*/Keys.None, /*About*/Keys.None] 156Keys shortcut = menuItemShortcuts[j][i]; 157if ((item is ToolStripMenuItem menuItem) && shortcut != Keys.None)
System\Windows\Forms\Design\StringCollectionEditor.StringCollectionForm.cs (1)
38if (e.KeyCode != Keys.Escape)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
1278(_localDragControl is not null && existingControl is not null && Control.ModifierKeys == Keys.Control))
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
2297: (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (5)
352bool removeSel = (Control.ModifierKeys & (Keys.Control | Keys.Shift)) > 0; 381bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0; 447else if (shiftPressed || (Control.ModifierKeys & Keys.Control) > 0) 874e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (2)
683bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0; 728bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
2600e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move; 2615e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (19)
1031case Keys.Up: 1036case Keys.Down: 1039case Keys.Escape: 1042case Keys.Return: 1064if (e.KeyCode == Keys.A && (e.KeyData & Keys.Control) != 0) 1512protected override bool IsInputKey(Keys keyData) 1514switch (keyData & Keys.KeyCode) 1516case Keys.Return: 1527protected override bool ProcessDialogKey(Keys keyData) 1662protected override bool ProcessDialogKey(Keys keyData) 1667if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 1669Keys keyCode = keyData & Keys.KeyCode; 1672case Keys.Tab: 1673retVal = ProcessTabKey((keyData & Keys.Shift) == Keys.None);
WindowsFormsIntegration (32)
System\Windows\Integration\Convert.cs (11)
189internal static SWI.ModifierKeys ToSystemWindowsInputModifierKeys(SWF.Keys keyData) 193if ((keyData & SWF.Keys.Alt) == SWF.Keys.Alt) 195if ((keyData & SWF.Keys.Control) == SWF.Keys.Control) 197if ((keyData & SWF.Keys.Shift) == SWF.Keys.Shift) 199if (((keyData & SWF.Keys.LWin) == SWF.Keys.LWin) || 200((keyData & SWF.Keys.RWin) == SWF.Keys.RWin))
System\Windows\Integration\ElementHost.cs (3)
454protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) 460_hostContainerInternal?.ProcessingTabKeyFromElementHost = (keyData & SWF.Keys.Tab) == SWF.Keys.Tab;
System\Windows\Integration\WindowsFormsHost.cs (18)
895protected override bool ProcessDialogKey(Keys keyData) 900if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 902Keys keyCode = (Keys)keyData & Keys.KeyCode; 903if (keyCode == Keys.Tab || keyCode == Keys.Left || 904keyCode == Keys.Right || keyCode == Keys.Up || 905keyCode == Keys.Down) 912if ((keyCode == Keys.Left || keyCode == Keys.Right || keyCode == Keys.Down || keyCode == Keys.Up) 916return c.SelectNextControl(this.ActiveControl, keyCode == Keys.Right || keyCode == Keys.Down, false, false, false);