3337 references to Keys
DesignSurface (19)
MainForm.Designer.cs (19)
191this.ToolStripMenuItemUnDo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); 199this.ToolStripMenuItemReDo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); 214this.ToolStripMenuItemCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); 224this.ToolStripMenuItemCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); 234this.ToolStripMenuItemPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); 242this.ToolStripMenuItemDelete.ShortcutKeys = System.Windows.Forms.Keys.Delete; 250this.ToolStripMenuItemKeyInvokeSmartTag.ShortcutKeys = System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F10;
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)
1640protected 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)
2395private protected static Keys LastKeyData { get; set; } 2507public static Keys ModifierKeys 2511Keys modifiers = 0; 2513if (PInvoke.GetKeyState((int)Keys.ShiftKey) < 0) 2515modifiers |= Keys.Shift; 2518if (PInvoke.GetKeyState((int)Keys.ControlKey) < 0) 2520modifiers |= Keys.Control; 2523if (PInvoke.GetKeyState((int)Keys.Menu) < 0) 2525modifiers |= Keys.Alt; 2542if (PInvoke.GetKeyState((int)Keys.LButton) < 0) 2547if (PInvoke.GetKeyState((int)Keys.RButton) < 0) 2552if (PInvoke.GetKeyState((int)Keys.MButton) < 0) 2557if (PInvoke.GetKeyState((int)Keys.XButton1) < 0) 2562if (PInvoke.GetKeyState((int)Keys.XButton2) < 0) 6202public static bool IsKeyLocked(Keys keyVal) 6204if (keyVal is Keys.Insert or Keys.NumLock or Keys.CapsLock or Keys.Scroll) 6215return keyVal is Keys.Insert or Keys.CapsLock ? (result & 0x1) != 0x0 : (result & 0x8001) != 0x0; 6239int mask = charCode == (char)(int)Keys.Tab 6259protected virtual bool IsInputKey(Keys keyData) 6261if ((keyData & Keys.Alt) == Keys.Alt) 6267switch (keyData & Keys.KeyCode) 6269case Keys.Tab: 6272case Keys.Left: 6273case Keys.Right: 6274case Keys.Up: 6275case Keys.Down: 7649&& (e.KeyCode.HasFlag(Keys.ControlKey) || e.KeyCode == Keys.Escape)) 8522/// For WM_KEYDOWN and WM_SYSKEYDOWN messages, this first calls <see cref="ProcessCmdKey(ref Message, Keys)"/> 8524/// <see cref="IsInputKey(Keys)"/> is called to check whether the key message represents an input key for the 8525/// control. Finally, if <see cref="IsInputKey(Keys)"/> indicates that the control isn't interested in the key 8526/// message, then <see cref="ProcessDialogKey(Keys)"/> is called to check for dialog keys such as TAB, arrow 8546/// <see cref="IsInputKey(Keys)"/>, <see cref="ProcessCmdKey(ref Message, Keys)"/>, <see cref="ProcessDialogChar(char)"/>, 8547/// or <see cref="ProcessDialogKey(Keys)"/>) instead of overriding this method. 8561Keys keyData = (Keys)(nint)msg.WParamInternal | ModifierKeys; 8629Keys keyData = (Keys)(nint)message.WParamInternal | ModifierKeys; 8693/// If the control has a parent, the key is passed to the parent's <see cref="ProcessCmdKey(ref Message, Keys)"/> 8699protected virtual bool ProcessCmdKey(ref Message msg, Keys keyData) => 8814/// arrow keys. This method is called only if the <see cref="IsInputKey(Keys)"/> method indicates that the control 8815/// is not processing the key. The <see cref="ProcessDialogKey(Keys)"/> simply sends the character to the parent's 8816/// <see cref="ProcessDialogKey(Keys)"/> method, or returns <see langword="false"/> if the control has no parent. 8820protected virtual bool ProcessDialogKey(Keys keyData) => _parent?.ProcessDialogKey(keyData) ?? false; 8874ke = new KeyEventArgs((Keys)(int)m.WParamInternal | ModifierKeys); 8956Keys keyCode = (Keys)(nint)msg.WParamInternal & Keys.KeyCode; 8958if (keyCode is not Keys.F10 and not Keys.Menu and not Keys.Tab) 8982if (keyCode is Keys.F10 or Keys.Menu) 8991if (keyCode == Keys.Tab) 12791static bool IsKeyDown(Keys key, ReadOnlySpan<byte> stateArray) 12799return IsKeyDown(Keys.Tab, stateArray) 12800|| IsKeyDown(Keys.Up, stateArray) 12801|| IsKeyDown(Keys.Down, stateArray) 12802|| IsKeyDown(Keys.Left, stateArray) 12803|| IsKeyDown(Keys.Right, stateArray) 12805|| IsKeyDown(Keys.Menu, stateArray) 12806|| IsKeyDown(Keys.F10, stateArray) 12807|| 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)
1120if (kevent.KeyData == Keys.Space) 1163if (kevent.KeyCode is Keys.Enter or Keys.Space)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
371if (PInvoke.GetKeyState((int)Keys.Tab) >= 0)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (33)
1442if (keyChar == (char)(int)Keys.Escape) 1446else if (keyChar == (char)(int)Keys.Return && DroppedDown) 2020Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2023if ((Keys)(int)m.WParamInternal == Keys.Delete) 2038Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2040if (keyChar == (char)Keys.Back) 2062else if (keyChar == (char)Keys.Escape) 2068if (keyChar != (char)Keys.Escape && keyChar != (char)Keys.Return && !DroppedDown 2134protected override bool IsInputKey(Keys keyData) 2136Keys keyCode = keyData & (Keys.KeyCode | Keys.Alt); 2137if (keyCode is Keys.Return or Keys.Escape) 2441if (e.KeyCode == Keys.Return) 2446else if ((e.KeyCode == Keys.Escape) && _autoCompleteDroppedDown) 2468if (!e.Handled && (e.KeyChar == (char)(int)Keys.Return || e.KeyChar == (char)(int)Keys.Escape) 2497private static bool ContainsNavigationKeyCode(Keys keyCode) => keyCode switch 2499Keys.Home or Keys.End or Keys.Left or Keys.Right => true, 2925protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 2929if (!returnedValue && keyData == (Keys.Control | Keys.A)) 2940&& (keyData == (Keys.Control | Keys.Back) || keyData == (Keys.Control | Keys.Shift | Keys.Back)))
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (335)
10065protected override bool IsInputKey(Keys keyData) 10067if ((keyData & Keys.Alt) == Keys.Alt) 10072switch (keyData & Keys.KeyCode) 10074case Keys.Escape: 10079case Keys.Tab: 10081return GetTabKeyEffective((keyData & Keys.Shift) == Keys.Shift, (keyData & Keys.Control) == Keys.Control); 10084case Keys.A: 10086if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Control) 10094case Keys.C: 10095case Keys.Insert: 10097if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Control) 10105case Keys.Space: 10107if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift 10118case Keys.Up: 10119case Keys.Down: 10120case Keys.Left: 10121case Keys.Right: 10122case Keys.Home: 10123case Keys.End: 10124case Keys.Next: 10125case Keys.Prior: 10126case Keys.Enter: 10127case Keys.Delete: 10128case Keys.D0: 10129case Keys.NumPad0: 10130case Keys.F2: 10131case Keys.F3: 11895Keys nModifier = ModifierKeys; 11896bool isControlDown = (nModifier & Keys.Control) == Keys.Control && (nModifier & Keys.Alt) == 0; 11897bool isShiftDown = (nModifier & Keys.Shift) == Keys.Shift; 11898bool isAltDown = (nModifier & Keys.Alt) == Keys.Alt; 15697switch (e.KeyData & Keys.KeyCode) 15699case Keys.A: 15700case Keys.C: 15701case Keys.D0: 15702case Keys.NumPad0: 15703case Keys.Delete: 15704case Keys.Down: 15705case Keys.F2: 15706case Keys.F3: 15707case Keys.F10: 15708case Keys.End: 15709case Keys.Enter: 15710case Keys.Escape: 15711case Keys.Home: 15712case Keys.Insert: 15713case Keys.Left: 15714case Keys.Next: 15715case Keys.Prior: 15716case Keys.Right: 15717case Keys.Space: 15718case Keys.Tab: 15719case Keys.Up: 15764if (_dataGridViewOper[OperationTrackKeyboardColResize] && (e.KeyData & Keys.Alt) != Keys.Alt) 16460if ((ModifierKeys & (Keys.Shift | Keys.Alt)) != 0 || MouseButtons != MouseButtons.None) 16465bool verticalScroll = ((ModifierKeys & Keys.Control) == 0); 19916protected bool ProcessAKey(Keys keyData) 19918if ((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == Keys.Control && MultiSelect) 19927protected bool ProcessDeleteKey(Keys keyData) 20054protected override bool ProcessDialogKey(Keys keyData) 20056Keys key = (keyData & Keys.KeyCode); 20058if (key == Keys.Enter) 20065else if (key == Keys.Escape) 20087else if (key is Keys.D0 or Keys.NumPad0) 20094else if (key is Keys.C or Keys.Insert) 20101else if (key == Keys.Tab) 20128keyData &= ~Keys.Control; 20145protected bool ProcessDownKey(Keys keyData) => ProcessDownKeyInternal(keyData, out bool _); 20147private bool ProcessDownKeyInternal(Keys keyData, out bool moved) 20174if ((keyData & Keys.Control) == Keys.Control) 20176if ((keyData & Keys.Shift) == Keys.Shift) 20299if ((keyData & Keys.Shift) == Keys.Shift) 20427if ((keyData & Keys.Control) == Keys.Control) 20429if ((keyData & Keys.Shift) == Keys.Shift) 20541if ((keyData & Keys.Shift) == Keys.Shift) 20663if ((keyData & Keys.Control) == Keys.Control) 20665if ((keyData & Keys.Shift) == Keys.Shift) 20811if ((keyData & Keys.Shift) == Keys.Shift) 20971if ((keyData & Keys.Control) == Keys.Control) 21069protected bool ProcessEndKey(Keys keyData) 21088if ((keyData & Keys.Control) == 0) 21090return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21104if ((keyData & Keys.Shift) == Keys.Shift) 21137if ((keyData & Keys.Control) == 0) 21139return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21153if ((keyData & Keys.Shift) == Keys.Shift) 21214if ((keyData & Keys.Control) == 0) 21216return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21231if ((keyData & Keys.Shift) == Keys.Shift) 21254if ((keyData & Keys.Control) == 0) 21256return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21260if ((keyData & Keys.Shift) == Keys.Shift) 21345if ((keyData & Keys.Control) == 0) 21347return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 21362if ((keyData & Keys.Shift) == Keys.Shift) 21398protected bool ProcessEnterKey(Keys keyData) 21405if ((keyData & Keys.Control) == 0) 21409keyData &= ~Keys.Shift; 21480protected bool ProcessEscapeKey(Keys keyData) 21499protected bool ProcessF2Key(Keys keyData) 21528protected bool ProcessF3Key(Keys keyData) 21546protected bool ProcessHomeKey(Keys keyData) 21562if ((keyData & Keys.Control) == 0) 21564return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21578if ((keyData & Keys.Shift) == Keys.Shift) 21611if ((keyData & Keys.Control) == 0) 21613return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21627if ((keyData & Keys.Shift) == Keys.Shift) 21688if ((keyData & Keys.Control) == 0) 21690return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21705if ((keyData & Keys.Shift) == Keys.Shift) 21733if ((keyData & Keys.Control) == 0) 21735return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21739if ((keyData & Keys.Shift) == Keys.Shift) 21824if ((keyData & Keys.Control) == 0) 21826return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 21856protected bool ProcessInsertKey(Keys keyData) 21858if (((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == Keys.Control 21859|| ((keyData & (Keys.Shift | Keys.Control | Keys.Alt)) == (Keys.Control | Keys.Shift) 21860&& (keyData & Keys.KeyCode) == Keys.C)) 21888KeyEventArgs ke = new((Keys)(nint)m.WParamInternal | ModifierKeys); 21889if (ke.KeyCode != Keys.ProcessKey || m.LParamInternal != 0x01) // Changing IME context does not trigger editing mode 21904if (BeginEditInternal(selectAll: !(ke.KeyCode == Keys.F2 && ModifierKeys == 0 && EditMode == DataGridViewEditMode.EditOnKeystrokeOrF2))) 21936KeyEventArgs ke = new((Keys)(nint)m.WParamInternal | ModifierKeys); 21946Keys.Escape or Keys.Space => true, 21951Keys.Delete 21952or Keys.Down 21953or Keys.End 21954or Keys.Enter 21955or Keys.Escape 21956or Keys.F2 21957or Keys.F3 21958or Keys.Home 21959or Keys.Left 21960or Keys.Next 21961or Keys.Prior 21962or Keys.Right 21963or Keys.Space 21964or Keys.Tab 21965or Keys.Up => true, 22003private bool? ProcessColumnResize(Keys keyData, int step) 22005if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns && _ptCurrentCell.X != -1) 22039protected bool ProcessControlShiftF10Keys(Keys keyData) 22061protected bool ProcessLeftKey(Keys keyData) => RightToLeftInternal 22065private bool ProcessLeftKeyPrivate(Keys keyData) 22101if ((keyData & Keys.Control) == Keys.Control) 22103return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22107if ((keyData & Keys.Shift) == Keys.Shift) 22212if ((keyData & Keys.Control) == Keys.Control) 22214return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22218if ((keyData & Keys.Shift) == Keys.Shift) 22321if ((keyData & Keys.Control) == Keys.Control) 22323return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22327if ((keyData & Keys.Shift) == Keys.Shift) 22465if ((keyData & Keys.Control) == Keys.Control) 22467return ProcessLeftMost((keyData & Keys.Shift) == Keys.Shift, firstVisibleColumnIndex, firstVisibleRowIndex); 22917protected bool ProcessNextKey(Keys keyData) 23031if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23071if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23107if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23180protected bool ProcessPriorKey(Keys keyData) 23290if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23329if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23365if ((keyData & Keys.Shift) == Keys.Shift && MultiSelect) 23438protected bool ProcessRightKey(Keys keyData) => RightToLeftInternal 23442private bool ProcessRightKeyPrivate(Keys keyData) 23480if ((keyData & Keys.Control) == Keys.Control) 23482return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 23486if ((keyData & Keys.Shift) == Keys.Shift) 23590if ((keyData & Keys.Control) == Keys.Control) 23592return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 23596if ((keyData & Keys.Shift) == Keys.Shift) 23699if ((keyData & Keys.Control) == Keys.Control) 23701return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 23705if ((keyData & Keys.Shift) == Keys.Shift) 23845if ((keyData & Keys.Control) == Keys.Control) 23847return ProcessRightMost((keyData & Keys.Shift) == Keys.Shift, lastVisibleColumnIndex, firstVisibleRowIndex); 24257protected bool ProcessSpaceKey(Keys keyData) 24259if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift && _ptCurrentCell.X != -1) 24342protected bool ProcessTabKey(Keys keyData) 24346if ((keyData & Keys.Control) == Keys.Control) 24348if ((keyData & Keys.Shift) == Keys.Shift) 24382if ((keyData & Keys.Control) == Keys.Control) 24388if ((keyData & Keys.Shift) == Keys.Shift) 24425case Keys.Tab: 24430case Keys.Up: 24435case Keys.Down: 24440case Keys.Next: 24445case Keys.Prior: 24450case Keys.Left: 24455case Keys.Right: 24460case Keys.F2: 24465case Keys.F3: 24470case Keys.F10: 24480case Keys.Home: 24485case Keys.D0: 24486case Keys.NumPad0: 24491case Keys.Delete: 24496case Keys.End: 24501case Keys.Enter: 24506case Keys.Escape: 24511case Keys.A: 24516case Keys.C: 24517case Keys.Insert: 24522case Keys.Space: 24531protected bool ProcessUpKey(Keys keyData) 24554if ((keyData & Keys.Control) == Keys.Control) 24556if ((keyData & Keys.Shift) == Keys.Shift) 24648if ((keyData & Keys.Shift) == Keys.Shift) 24752if ((keyData & Keys.Control) == Keys.Control) 24754if ((keyData & Keys.Shift) == Keys.Shift) 24839if ((keyData & Keys.Shift) == Keys.Shift) 24936if ((keyData & Keys.Control) == Keys.Control) 24938if ((keyData & Keys.Shift) == Keys.Shift) 25057if ((keyData & Keys.Shift) == Keys.Shift) 25189if ((keyData & Keys.Control) == Keys.Control) 25269protected bool ProcessZeroKey(Keys keyData) 25289if ((keyData & (Keys.Alt | Keys.Shift | Keys.Control)) == Keys.Control && IsCurrentCellInEditMode) 30020Keys modifierKeys = ModifierKeys; 30021if (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)
1382sb.Append((char)Keys.Return); 1383sb.Append((char)Keys.LineFeed); 1388sb.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)
1030protected override bool IsInputKey(Keys keyData) 1032if ((keyData & Keys.Alt) == Keys.Alt) 1037return (keyData & Keys.KeyCode) switch 1039Keys.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)
797if (e.KeyCode == Keys.Enter) 1406protected override bool ProcessDialogKey(Keys keyData) 1408if ((keyData & (Keys.Alt | Keys.Control)) != Keys.Alt) 1410Keys keyCode = keyData & Keys.KeyCode; 1413case Keys.Tab: 1416bool forward = (keyData & Keys.Shift) != Keys.Shift; 1424case Keys.Up: 1425case Keys.Left: 1432case Keys.Down: 1433case Keys.Right:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (10)
916Keys keycode = (Keys)m.WParamInternal.LOWORD; 919Keys.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)
575protected override bool IsInputKey(Keys keyData) 577if ((keyData & Keys.Alt) == Keys.Alt) 582return (keyData & Keys.KeyCode) switch 584Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true,
System\Windows\Forms\Controls\ListView\ListView.cs (16)
4255protected override bool IsInputKey(Keys keyData) 4257if ((keyData & Keys.Alt) == Keys.Alt) 4262switch (keyData & Keys.KeyCode) 4264case Keys.PageUp: 4265case Keys.PageDown: 4266case Keys.Home: 4267case Keys.End: 4279switch (keyData & Keys.KeyCode) 4281case Keys.Return: 4282case Keys.Escape: 6691if ((lvkd->wVKey == (short)Keys.Down || lvkd->wVKey == (short)Keys.Up) && SelectedItems.Count > 0) 6694if (lvkd->wVKey == (short)Keys.Down 6705if (lvkd->wVKey == (short)Keys.Up 6717if (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)
1336protected override bool IsInputKey(Keys keyData) 1338if ((keyData & Keys.Alt) == Keys.Alt) 1343return (keyData & Keys.KeyCode) switch 1345Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true,
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (6)
3215protected override bool ProcessDialogKey(Keys keyData) 3217if ((keyData & Keys.KeyCode) != Keys.Tab 3218|| keyData.HasFlag(Keys.Control) 3219|| keyData.HasFlag(Keys.Alt)) 3225if (keyData.HasFlag(Keys.Shift))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (77)
1497if (_dropDownHolder?.Visible == true && m.MsgInternal == PInvokeCore.WM_KEYDOWN && (Keys)(nint)m.WParamInternal != Keys.Tab) 1546Keys modifiers = ModifierKeys; 1547if ((modifiers & ~Keys.Shift) != 0) 1563case unchecked((char)(int)(long)Keys.Tab): 2022protected override bool IsInputKey(Keys keyData) 2024switch (keyData & Keys.KeyCode) 2026case Keys.Escape: 2027case Keys.Tab: 2028case Keys.F4: 2031case Keys.Return: 2322if (e.KeyCode == Keys.Return) 2430private bool ProcessEnumUpAndDown(GridEntry entry, Keys keyCode, bool closeDropDown = true) 2458if (keyCode == Keys.Up) 2488if (!e.Alt && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)) 2503else if ((e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) 2504&& (e.Modifiers & ~Keys.Shift) != 0) 2627if ((ModifierKeys & (Keys.Alt | Keys.Control)) != 0) 2709Keys keyCode = e.KeyCode; 2714if (keyCode == Keys.Tab) 2724if (keyCode == Keys.Down && altPressed && DropDownButton.Visible) 2730if (keyCode == Keys.Up && altPressed && DropDownButton.Visible && (_dropDownHolder is not null) && _dropDownHolder.Visible) 2745case Keys.Up: 2746case Keys.Down: 2747int position = keyCode == Keys.Up ? _selectedRow - 1 : _selectedRow + 1; 2751case Keys.Left: 2770case Keys.Right: 2796case Keys.Return: 2807case Keys.Home: 2808case Keys.End: 2810SelectGridEntry(allEntries[keyCode == Keys.Home ? 0 : allEntries.Count - 1], pageIn: true); 2812case Keys.Add: 2813case Keys.Oemplus: 2814case Keys.OemMinus: 2815case Keys.Subtract: 2823bool expand = keyCode is Keys.Add or Keys.Oemplus; 2829case Keys.D8: 2832goto case Keys.Multiply; 2836case Keys.Multiply: 2842case Keys.Prior: // PAGE_UP 2843case Keys.Next: // PAGE_DOWN 2845bool next = keyCode == Keys.Next; 2874case Keys.Insert: 2878goto case Keys.V; 2881goto case Keys.C; 2882case Keys.C: 2891case Keys.Delete: 2896goto case Keys.X; 2900case Keys.X: 2910case Keys.V: 2918case Keys.A: 2929if (e.KeyData == (Keys.C | Keys.Alt | Keys.Shift | Keys.Control)) 2939&& (keyCode == Keys.Up || keyCode == Keys.Down)) 3133if ((ModifierKeys & (Keys.Shift | Keys.Alt)) != 0 || MouseButtons != MouseButtons.None) 3817protected override bool ProcessDialogKey(Keys keyData) 3821Keys keyCode = keyData & Keys.KeyCode; 3824case Keys.F4: 3838case Keys.Tab: 3840if (((keyData & Keys.Control) != 0) || 3841((keyData & Keys.Alt) != 0)) 3846bool forward = (keyData & Keys.Shift) == 0; 3908case Keys.Up: 3909case Keys.Down: 3910case Keys.Left: 3911case Keys.Right: 3913case Keys.Return: 5339if (_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)
2592protected 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)
804if (_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, 1376if (ke.KeyCode == Keys.Tab && (ke.KeyData & Keys.Control) != 0) 1378bool forward = (ke.KeyData & Keys.Shift) == 0; 1382if (ke.KeyCode == Keys.PageDown && (ke.KeyData & Keys.Control) != 0) 1387if (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)
533protected override bool IsInputKey(Keys keyData) 535if (Multiline && (keyData & Keys.Alt) == 0) 537switch (keyData & Keys.KeyCode) 539case Keys.Return: 689protected override bool ProcessCmdKey(ref Message m, Keys keyData) 692if (!returnValue && ShortcutsEnabled && (keyData == (Keys.Control | Keys.A)))
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (36)
165(int)Shortcut.CtrlE, (int)Shortcut.CtrlY, (int)Keys.Control + (int)Keys.Back, 176protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 187(int)keyData == (shortcutValue | (int)Keys.Shift)) 209if (!ReadOnly && (keyData == (Keys.Control | Keys.Back) || keyData == (Keys.Control | Keys.Shift | Keys.Back))) 1267protected bool ContainsNavigationKeyCode(Keys keyCode) => keyCode switch 1269Keys.Up or Keys.Down or Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End or Keys.Left or Keys.Right => true, 1316protected override bool IsInputKey(Keys keyData) 1318if ((keyData & Keys.Alt) != Keys.Alt) 1320switch (keyData & Keys.KeyCode) 1322case Keys.Tab: 1325return Multiline && _textBoxFlags[s_acceptsTab] && ((keyData & Keys.Control) == 0); 1326case Keys.Escape: 1333case Keys.Back: 1340case Keys.PageUp: 1341case Keys.PageDown: 1342case Keys.Home: 1343case Keys.End: 1396protected override bool ProcessDialogKey(Keys keyData) 1398Keys keyCode = keyData & Keys.KeyCode; 1400if (keyCode == Keys.Tab && AcceptsTab && (keyData & Keys.Control) != 0) 1403keyData &= ~Keys.Control;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (39)
51private Dictionary<Keys, ToolStripMenuItem>? _shortcuts; 1646internal Dictionary<Keys, ToolStripMenuItem> Shortcuts 1650_shortcuts ??= new Dictionary<Keys, ToolStripMenuItem>(1); 2053bool forward = LastKeyData == Keys.Tab || (TabStop && start is null && LastKeyData != Keys.Left); 2551protected override bool IsInputKey(Keys keyData) => 2642internal bool ProcessCmdKeyInternal(ref Message m, Keys keyData) 2675protected override bool ProcessCmdKey(ref Message m, Keys keyData) 2714(keyData & Keys.Control) == Keys.Control && (keyData & Keys.KeyCode) == Keys.Tab; 2719&& ToolStripManager.SelectNextToolStrip(this, forward: (keyData & Keys.Shift) == Keys.None)) 2738protected override bool ProcessDialogKey(Keys keyData) 2756bool hasModifiers = ((keyData & (Keys.Alt | Keys.Control)) != Keys.None); 2758Keys keyCode = keyData & Keys.KeyCode; 2761case Keys.Back: 2771case Keys.Tab: 2775retVal = ProcessTabKey((keyData & Keys.Shift) == Keys.None); 2779case Keys.Left: 2780case Keys.Right: 2781case Keys.Up: 2782case Keys.Down: 2785case Keys.Home: 2789case Keys.End: 2793case Keys.Escape: // escape and menu key should restore focus 2848if (!inMenuMode && ModifierKeys == Keys.Alt) 3037internal virtual bool ProcessArrowKey(Keys keyCode) 3044case Keys.Left: 3045case Keys.Right: 3046retVal = ProcessLeftRightArrowKey(keyCode == Keys.Right); 3048case Keys.Up: 3049case Keys.Down: 3053if (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)
2055if (Control.ModifierKeys == Keys.Alt) 2403protected internal virtual bool IsInputKey(Keys keyData) => false; 2469if (PInvoke.GetKeyState((int)Keys.LButton) < 0) 3043protected internal virtual bool ProcessDialogKey(Keys keyData) 3045if (keyData == Keys.Enter || (_state[s_stateSupportsSpaceKey] && keyData == Keys.Space)) 3064protected internal virtual bool ProcessCmdKey(ref Message m, Keys keyData) => false;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (27)
665public static bool IsValidShortcut(Keys shortcut) 668Keys keyCode = shortcut & Keys.KeyCode; 669Keys modifiers = shortcut & Keys.Modifiers; 671if (shortcut == Keys.None) 675else if (keyCode is Keys.Delete or Keys.Insert) 679else if ((int)keyCode is >= ((int)Keys.F1) and <= ((int)Keys.F24)) 684else if ((keyCode != Keys.None) && (modifiers != Keys.None)) 688case Keys.Menu: 689case Keys.ControlKey: 690case Keys.ShiftKey: 694if (modifiers == Keys.Shift) 708internal static bool IsMenuKey(Keys keyData) 709=> (keyData & Keys.KeyCode) is Keys.Menu or Keys.F10; 711public static bool IsShortcutDefined(Keys shortcut) 728internal static bool ProcessCmdKey(ref Message m, Keys keyData) 753internal static bool ProcessShortcut(ref Message m, Keys shortcut) 890Keys keyData = (Keys)(nint)m.LParamInternal; 933if (PInvoke.GetKeyState((int)Keys.ShiftKey) < 0 && (keyData == Keys.None))
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (2)
265Keys 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)
839protected override bool IsInputKey(Keys keyData) 841if ((keyData & Keys.Alt) == Keys.Alt) 846return (keyData & Keys.KeyCode) switch 848Keys.PageUp or Keys.PageDown or Keys.Home or Keys.End => true, 924if ((ModifierKeys & (Keys.Shift | Keys.Alt)) != 0 || MouseButtons != MouseButtons.None)
System\Windows\Forms\Controls\TreeView\TreeView.cs (13)
1804protected override bool IsInputKey(Keys keyData) 1809if (_editNode is not null && (keyData & Keys.Alt) == 0) 1811switch (keyData & Keys.KeyCode) 1813case Keys.Return: 1814case Keys.Escape: 1815case Keys.PageUp: 1816case Keys.PageDown: 1817case Keys.Home: 1818case Keys.End: 2257if (CheckBoxes && (e.KeyData & Keys.KeyCode) == Keys.Space) 2287if ((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)
598if (e.KeyData == Keys.Up) 605else if (e.KeyData == Keys.Down) 613if (e.KeyCode == Keys.Return && UserEdit) 733if ((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)
4658protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 4688protected override bool ProcessDialogKey(Keys keyData) 4690if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 4692Keys keyCode = keyData & Keys.KeyCode; 4696case Keys.Return: 4709case 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)
636case Keys.Delete: 639case 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)
528protected 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)
77protected override bool ProcessDialogKey(Keys keyData) 79if ((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)
296protected override bool ProcessDialogKey(Keys keyData) 298if ((keyData & Keys.KeyCode) == Keys.Return && (keyData & (Keys.Alt | Keys.Control)) == 0) 304if ((keyData & Keys.KeyCode) == Keys.Escape && (keyData & (Keys.Alt | Keys.Control)) == 0) 310if ((keyData & Keys.KeyCode) == Keys.Tab && (keyData & (Keys.Alt | Keys.Control)) == 0) 316i += (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)
619bool 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)
297bool 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)
2165_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)
1037if ((e.Modifiers) == 0 && e.KeyCode == Keys.F4) 1046Keys modifierKeys = ModifierKeys; 1050if ((modifierKeys & Keys.Control) != 0)
System\Windows\Forms\Design\DesignBindingPicker.cs (5)
1874protected override bool IsInputKey(Keys key) 1876return (key == Keys.Return) || base.IsInputKey(key); 2089if (e.KeyData == Keys.Return && SelectedNode is not null) 2098protected override bool IsInputKey(Keys key) 2100return key == Keys.Return || base.IsInputKey(key);
System\Windows\Forms\Design\DesignerFrame.cs (11)
157protected override bool ProcessDialogKey(Keys keyData) 191Keys keycode = (Keys)(m.WParamInternal & 0xFFFF); 194Keys.Up => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_VSCROLL), 195Keys.Down => (SCROLLBAR_COMMAND.SB_LINEDOWN, (MessageId)PInvokeCore.WM_VSCROLL), 196Keys.PageUp => (SCROLLBAR_COMMAND.SB_PAGEUP, (MessageId)PInvokeCore.WM_VSCROLL), 197Keys.PageDown => (SCROLLBAR_COMMAND.SB_PAGEDOWN, (MessageId)PInvokeCore.WM_VSCROLL), 198Keys.Home => (SCROLLBAR_COMMAND.SB_TOP, (MessageId)PInvokeCore.WM_VSCROLL), 199Keys.End => (SCROLLBAR_COMMAND.SB_BOTTOM, (MessageId)PInvokeCore.WM_VSCROLL), 200Keys.Left => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_HSCROLL), 201Keys.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)
538_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)
88Keys[][] menuItemShortcuts = 90[/*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], 91[/*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], 92[/*Tools*/Keys.None, /*Customize*/Keys.None, /*Options*/Keys.None], 93[/*Help*/Keys.None, /*Contents*/Keys.None, /*Index*/Keys.None, /*Search*/Keys.None, /*Separator*/Keys.None, /*About*/Keys.None] 157Keys shortcut = menuItemShortcuts[j][i]; 158if ((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)
1284(_localDragControl is not null && existingControl is not null && Control.ModifierKeys == Keys.Control))
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
2324: (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) 877e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (2)
686bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0; 731bool shiftPressed = (Control.ModifierKeys & Keys.Shift) > 0;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
2648e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move; 2663e.Effect = (Control.ModifierKeys == Keys.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (19)
1040case Keys.Up: 1045case Keys.Down: 1048case Keys.Escape: 1051case Keys.Return: 1073if (e.KeyCode == Keys.A && (e.KeyData & Keys.Control) != 0) 1521protected override bool IsInputKey(Keys keyData) 1523switch (keyData & Keys.KeyCode) 1525case Keys.Return: 1536protected override bool ProcessDialogKey(Keys keyData) 1671protected override bool ProcessDialogKey(Keys keyData) 1676if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 1678Keys keyCode = keyData & Keys.KeyCode; 1681case Keys.Tab: 1682retVal = ProcessTabKey((keyData & Keys.Shift) == Keys.None);
System.Windows.Forms.Design.Tests (5)
EnsureEditorsTests.cs (1)
66[InlineData(typeof(Keys), typeof(ShortcutKeysEditor))]
System\Windows\Forms\Design\DesignerFrameTests.cs (3)
23public new bool ProcessDialogKey(Keys keyData) 90bool result = designerFrame.ProcessDialogKey(Keys.Enter); 160bool result = designerFrame.ProcessDialogKey(Keys.Enter);
System\Windows\Forms\Design\MaskedTextBoxTextEditorDropDownTests.cs (1)
34bool processDialogKey = dropDown.TestAccessor().Dynamic.ProcessDialogKey(Keys.Escape);
System.Windows.Forms.Tests (1233)
KeyboardTooltipStateMachineTests.cs (18)
53[InlineData(Keys.ControlKey)] 54[InlineData(Keys.Escape)] 55[InlineData(Keys.ControlKey | Keys.ShiftKey | Keys.F10)] 56public void KeyboardTooltipStateMachine_DismissalKeyUp_NonPersistent_NotDismissed(Keys keys) 82[InlineData(Keys.ControlKey, true)] 83[InlineData(Keys.Escape, true)] 84[InlineData(Keys.ControlKey | Keys.ShiftKey | Keys.F10, true)] 85[InlineData(Keys.ControlKey, false)] 86[InlineData(Keys.Escape, false)] 87[InlineData(Keys.ControlKey | Keys.ShiftKey | Keys.F10, false)] 88public void KeyboardTooltipStateMachine_DismissalKeyUp(Keys keys, bool isPersistent) 114public void SimulateKeyUp(Keys keys) => base.OnKeyUp(new KeyEventArgs(keys));
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (8)
762KeyboardSimulator.KeyPress(listView, Keys.Up); 763KeyboardSimulator.KeyPress(listView, Keys.Left); 768KeyboardSimulator.KeyPress(listView, Keys.Left); 774KeyboardSimulator.KeyPress(listView, Keys.Right); 779KeyboardSimulator.KeyPress(listView, Keys.Right); 812KeyboardSimulator.KeyPress(listView, Keys.Down); 817KeyboardSimulator.KeyPress(listView, Keys.Up); 827KeyboardSimulator.KeyPress(listView, Keys.Left);
System\Windows\Forms\ButtonBaseTests.cs (74)
5485yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Cancel), false, false }; 5486yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Enter), false, false }; 5487yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Space), true, expectedIsHandleCreated }; 5530yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Cancel), false }; 5531yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Enter), false }; 5532yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Space), true }; 5576yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Cancel), false, 0 }; 5577yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Enter), false, 0 }; 5578yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Space), true, 1 }; 5634yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Cancel), false }; 5635yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Enter), false }; 5636yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Space), true }; 5688[InlineData(FlatStyle.Flat, Keys.Cancel, 0)] 5689[InlineData(FlatStyle.Flat, Keys.Enter, 0)] 5690[InlineData(FlatStyle.Flat, Keys.Space, 0)] 5691[InlineData(FlatStyle.Popup, Keys.Cancel, 0)] 5692[InlineData(FlatStyle.Popup, Keys.Enter, 0)] 5693[InlineData(FlatStyle.Popup, Keys.Space, 0)] 5694[InlineData(FlatStyle.Standard, Keys.Cancel, 0)] 5695[InlineData(FlatStyle.Standard, Keys.Enter, 0)] 5696[InlineData(FlatStyle.Standard, Keys.Space, 0)] 5697[InlineData(FlatStyle.System, Keys.Cancel, 0)] 5698[InlineData(FlatStyle.System, Keys.Enter, 0)] 5699[InlineData(FlatStyle.System, Keys.Space, 0)] 5700public void ButtonBase_OnKeyDown_GetState_ReturnsExpected(FlatStyle flatStyle, Keys key, int expected) 5712[InlineData(FlatStyle.Flat, Keys.Cancel, 0)] 5713[InlineData(FlatStyle.Flat, Keys.Enter, 0)] 5714[InlineData(FlatStyle.Flat, Keys.Space, 0)] 5715[InlineData(FlatStyle.Popup, Keys.Cancel, 0)] 5716[InlineData(FlatStyle.Popup, Keys.Enter, 0)] 5717[InlineData(FlatStyle.Popup, Keys.Space, 0)] 5718[InlineData(FlatStyle.Standard, Keys.Cancel, 0)] 5719[InlineData(FlatStyle.Standard, Keys.Enter, 0)] 5720[InlineData(FlatStyle.Standard, Keys.Space, 0)] 5721[InlineData(FlatStyle.System, Keys.Cancel, 0)] 5722[InlineData(FlatStyle.System, Keys.Enter, 0)] 5723[InlineData(FlatStyle.System, Keys.Space, 0)] 5724public void ButtonBase_OnKeyDown_MouseDownGetState_ReturnsExpected(FlatStyle flatStyle, Keys key, int expected) 5749yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.None) }; 5750yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Cancel) }; 5751yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Enter) }; 5752yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Space) }; 5799yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Cancel), 0, expectedIsHandleCreated }; 5800yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Enter), 1, expectedIsHandleCreated }; 5801yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Space), 1, expectedIsHandleCreated }; 5904yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Cancel), 0, expectedCallCount }; 5905yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Enter), 1, expectedCallCount }; 5906yield return new object[] { flatStyle, enabled, new KeyEventArgs(Keys.Space), 1, expectedCallCount }; 5967[InlineData(FlatStyle.Flat, Keys.Cancel, 0)] 5968[InlineData(FlatStyle.Flat, Keys.Enter, 0)] 5969[InlineData(FlatStyle.Flat, Keys.Space, 0)] 5970[InlineData(FlatStyle.Popup, Keys.Cancel, 0)] 5971[InlineData(FlatStyle.Popup, Keys.Enter, 0)] 5972[InlineData(FlatStyle.Popup, Keys.Space, 0)] 5973[InlineData(FlatStyle.Standard, Keys.Cancel, 0)] 5974[InlineData(FlatStyle.Standard, Keys.Enter, 0)] 5975[InlineData(FlatStyle.Standard, Keys.Space, 0)] 5976[InlineData(FlatStyle.System, Keys.Cancel, 0)] 5977[InlineData(FlatStyle.System, Keys.Enter, 0)] 5978[InlineData(FlatStyle.System, Keys.Space, 0)] 5979public void ButtonBase_OnKeyUp_GetState_ReturnsExpected(FlatStyle flatStyle, Keys key, int expected) 5991[InlineData(FlatStyle.Flat, Keys.Cancel, 0)] 5992[InlineData(FlatStyle.Flat, Keys.Enter, 0)] 5993[InlineData(FlatStyle.Flat, Keys.Space, 0)] 5994[InlineData(FlatStyle.Popup, Keys.Cancel, 0)] 5995[InlineData(FlatStyle.Popup, Keys.Enter, 0)] 5996[InlineData(FlatStyle.Popup, Keys.Space, 0)] 5997[InlineData(FlatStyle.Standard, Keys.Cancel, 0)] 5998[InlineData(FlatStyle.Standard, Keys.Enter, 0)] 5999[InlineData(FlatStyle.Standard, Keys.Space, 0)] 6000[InlineData(FlatStyle.System, Keys.Cancel, 0)] 6001[InlineData(FlatStyle.System, Keys.Enter, 0)] 6002[InlineData(FlatStyle.System, Keys.Space, 0)] 6003public void ButtonBase_OnKeyUp_MouseDownGetState_ReturnsExpected(FlatStyle flatStyle, Keys key, int expected)
System\Windows\Forms\ComboBoxTests.cs (8)
1724tb.ProcessCmdKey(ref message, Keys.Control | Keys.Back); 2598[InlineData(Keys.Up, 9, 9)] 2599[InlineData(Keys.Down, 9, 0)] 2600public void ComboBox_Select_Item_By_Key(Keys key, int expectedKeyPressesCount, int selectedIndex) 2776public void OnKeyUp() => base.OnKeyUp(new KeyEventArgs(Keys.Left)); 2900public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData); 2934public new bool ProcessCmdKey(ref Message msg, Keys keyData) => base.ProcessCmdKey(ref msg, keyData);
System\Windows\Forms\ControlTests.cs (3)
1234public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData); 1394public new bool ProcessCmdKey(ref Message msg, Keys keyData) => base.ProcessCmdKey(ref msg, keyData); 1398public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ControlTests.Methods.cs (260)
4336public void Control_IsInputChar_InvokeWithoutHandle_ReturnsExpected(Keys keyData, bool expected) 4345public void Control_IsInputChar_InvokeWithHandle_ReturnsExpected(Keys keyData, bool expected) 4355yield return new object[] { Keys.Tab, false }; 4356yield return new object[] { Keys.Up, false }; 4357yield return new object[] { Keys.Down, false }; 4358yield return new object[] { Keys.Left, false }; 4359yield return new object[] { Keys.Right, false }; 4360yield return new object[] { Keys.Return, false }; 4361yield return new object[] { Keys.Escape, false }; 4362yield return new object[] { Keys.A, false }; 4363yield return new object[] { Keys.C, false }; 4364yield return new object[] { Keys.Insert, false }; 4365yield return new object[] { Keys.Space, false }; 4366yield return new object[] { Keys.Home, false }; 4367yield return new object[] { Keys.End, false }; 4368yield return new object[] { Keys.Back, false }; 4369yield return new object[] { Keys.Next, false }; 4370yield return new object[] { Keys.Prior, false }; 4371yield return new object[] { Keys.Delete, false }; 4372yield return new object[] { Keys.D0, false }; 4373yield return new object[] { Keys.NumPad0, false }; 4374yield return new object[] { Keys.F1, false }; 4375yield return new object[] { Keys.F2, false }; 4376yield return new object[] { Keys.F3, false }; 4377yield return new object[] { Keys.F4, false }; 4378yield return new object[] { Keys.F10, false }; 4379yield return new object[] { Keys.RButton, false }; 4380yield return new object[] { Keys.PageUp, false }; 4381yield return new object[] { Keys.PageDown, false }; 4382yield return new object[] { Keys.Menu, false }; 4383yield return new object[] { Keys.None, false }; 4385yield return new object[] { Keys.Control | Keys.Tab, false }; 4386yield return new object[] { Keys.Control | Keys.Up, false }; 4387yield return new object[] { Keys.Control | Keys.Down, false }; 4388yield return new object[] { Keys.Control | Keys.Left, false }; 4389yield return new object[] { Keys.Control | Keys.Right, false }; 4390yield return new object[] { Keys.Control | Keys.Return, false }; 4391yield return new object[] { Keys.Control | Keys.Escape, false }; 4392yield return new object[] { Keys.Control | Keys.A, false }; 4393yield return new object[] { Keys.Control | Keys.C, false }; 4394yield return new object[] { Keys.Control | Keys.Insert, false }; 4395yield return new object[] { Keys.Control | Keys.Space, false }; 4396yield return new object[] { Keys.Control | Keys.Home, false }; 4397yield return new object[] { Keys.Control | Keys.End, false }; 4398yield return new object[] { Keys.Control | Keys.Back, false }; 4399yield return new object[] { Keys.Control | Keys.Next, false }; 4400yield return new object[] { Keys.Control | Keys.Prior, false }; 4401yield return new object[] { Keys.Control | Keys.Delete, false }; 4402yield return new object[] { Keys.Control | Keys.D0, false }; 4403yield return new object[] { Keys.Control | Keys.NumPad0, false }; 4404yield return new object[] { Keys.Control | Keys.F1, false }; 4405yield return new object[] { Keys.Control | Keys.F2, false }; 4406yield return new object[] { Keys.Control | Keys.F3, false }; 4407yield return new object[] { Keys.Control | Keys.F4, false }; 4408yield return new object[] { Keys.Control | Keys.F10, false }; 4409yield return new object[] { Keys.Control | Keys.RButton, false }; 4410yield return new object[] { Keys.Control | Keys.PageUp, false }; 4411yield return new object[] { Keys.Control | Keys.PageDown, false }; 4412yield return new object[] { Keys.Control | Keys.Menu, false }; 4413yield return new object[] { Keys.Control | Keys.None, false }; 4415yield return new object[] { Keys.Alt | Keys.Tab, false }; 4416yield return new object[] { Keys.Alt | Keys.Up, false }; 4417yield return new object[] { Keys.Alt | Keys.Down, false }; 4418yield return new object[] { Keys.Alt | Keys.Left, false }; 4419yield return new object[] { Keys.Alt | Keys.Right, false }; 4420yield return new object[] { Keys.Alt | Keys.Return, false }; 4421yield return new object[] { Keys.Alt | Keys.Escape, false }; 4422yield return new object[] { Keys.Alt | Keys.A, false }; 4423yield return new object[] { Keys.Alt | Keys.C, false }; 4424yield return new object[] { Keys.Alt | Keys.Insert, false }; 4425yield return new object[] { Keys.Alt | Keys.Space, false }; 4426yield return new object[] { Keys.Alt | Keys.Home, false }; 4427yield return new object[] { Keys.Alt | Keys.End, false }; 4428yield return new object[] { Keys.Alt | Keys.Back, false }; 4429yield return new object[] { Keys.Alt | Keys.Next, false }; 4430yield return new object[] { Keys.Alt | Keys.Prior, false }; 4431yield return new object[] { Keys.Alt | Keys.Delete, false }; 4432yield return new object[] { Keys.Alt | Keys.D0, false }; 4433yield return new object[] { Keys.Alt | Keys.NumPad0, false }; 4434yield return new object[] { Keys.Alt | Keys.F1, false }; 4435yield return new object[] { Keys.Alt | Keys.F2, false }; 4436yield return new object[] { Keys.Alt | Keys.F3, false }; 4437yield return new object[] { Keys.Alt | Keys.F4, false }; 4438yield return new object[] { Keys.Alt | Keys.F10, false }; 4439yield return new object[] { Keys.Alt | Keys.RButton, false }; 4440yield return new object[] { Keys.Alt | Keys.PageUp, false }; 4441yield return new object[] { Keys.Alt | Keys.PageDown, false }; 4442yield return new object[] { Keys.Alt | Keys.Menu, false }; 4443yield return new object[] { Keys.Alt | Keys.None, false }; 4448public void Control_IsInputKey_InvokeWithoutHandle_ReturnsExpected(Keys keyData, bool expected) 4457public void Control_IsInputKey_InvokeWithHandle_ReturnsExpected(Keys keyData, bool expected) 5259yield return new object[] { 0, Keys.None, false }; 5260yield return new object[] { 0, Keys.A, false }; 5261yield return new object[] { 0, Keys.Tab, false }; 5262yield return new object[] { 0, Keys.Menu, false }; 5263yield return new object[] { 0, Keys.F10, false }; 5265yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.None, false }; 5266yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.A, false }; 5267yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.Tab, true }; 5268yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.Menu, true }; 5269yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.F10, true }; 5271yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.None, false }; 5272yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.A, false }; 5273yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.Tab, true }; 5274yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.Menu, true }; 5275yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.F10, true }; 5277yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.None, false }; 5278yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.A, false }; 5279yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.Tab, false }; 5280yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.Menu, false }; 5281yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.F10, false }; 5283yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.None, false }; 5284yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.A, false }; 5285yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.Tab, false }; 5286yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.Menu, false }; 5287yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.F10, false }; 5289yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.None, true }; 5290yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.A, true }; 5291yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.Tab, true }; 5292yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.Menu, true }; 5293yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.F10, true }; 5295yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.None, false }; 5296yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.A, false }; 5297yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.Tab, false }; 5298yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.Menu, false }; 5299yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.F10, false }; 5301yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.None, false }; 5302yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.A, false }; 5303yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.Tab, false }; 5304yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.Menu, false }; 5305yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.F10, false }; 5307yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.None, false }; 5308yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.A, false }; 5309yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.Tab, false }; 5310yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.Menu, false }; 5311yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.F10, false }; 5316public void Control_PreProcessMessage_Invoke_ReturnsExpected(int windowMsg, Keys keys, bool expectedIsHandleCreated) 5330public void Control_PreProcessMessage_InvokeWithParent_ReturnsExpected(int windowMsg, Keys keys, bool expectedIsHandleCreated) 5348yield return new object[] { 0, Keys.None, false, false, false, false, false, false, 0, 0, 0, 0, 0 }; 5349yield return new object[] { 0, Keys.A, false, false, false, false, false, false, 0, 0, 0, 0, 0 }; 5351yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.None, true, false, false, false, false, true, 1, 0, 0, 0, 0 }; 5352yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.None, false, true, false, false, false, false, 1, 1, 0, 0, 0 }; 5353yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.None, false, false, true, false, false, true, 1, 1, 1, 0, 0 }; 5354yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.None, false, false, false, false, false, false, 1, 1, 1, 0, 0 }; 5355yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.A, true, false, false, false, false, true, 1, 0, 0, 0, 0 }; 5356yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.A, false, true, false, false, false, false, 1, 1, 0, 0, 0 }; 5357yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.A, false, false, true, false, false, true, 1, 1, 1, 0, 0 }; 5358yield return new object[] { (int)PInvokeCore.WM_KEYDOWN, Keys.A, false, false, false, false, false, false, 1, 1, 1, 0, 0 }; 5360yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.None, true, false, false, false, false, true, 1, 0, 0, 0, 0 }; 5361yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.None, false, true, false, false, false, false, 1, 1, 0, 0, 0 }; 5362yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.None, false, false, true, false, false, true, 1, 1, 1, 0, 0 }; 5363yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.None, false, false, false, false, false, false, 1, 1, 1, 0, 0 }; 5364yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.A, true, false, false, false, false, true, 1, 0, 0, 0, 0 }; 5365yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.A, false, true, false, false, false, false, 1, 1, 0, 0, 0 }; 5366yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.A, false, false, true, false, false, true, 1, 1, 1, 0, 0 }; 5367yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN, Keys.A, false, false, false, false, false, false, 1, 1, 1, 0, 0 }; 5369yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.None, false, false, false, true, false, false, 0, 0, 0, 1, 0 }; 5370yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.None, false, false, false, true, true, false, 0, 0, 0, 1, 0 }; 5371yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.None, false, false, false, false, true, true, 0, 0, 0, 1, 1 }; 5372yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.None, false, false, false, false, false, false, 0, 0, 0, 1, 1 }; 5373yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.A, false, false, false, true, false, false, 0, 0, 0, 1, 0 }; 5374yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.A, false, false, false, true, true, false, 0, 0, 0, 1, 0 }; 5375yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.A, false, false, false, false, true, true, 0, 0, 0, 1, 1 }; 5376yield return new object[] { (int)PInvokeCore.WM_CHAR, Keys.A, false, false, false, false, false, false, 0, 0, 0, 1, 1 }; 5378yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.None, false, false, false, true, false, false, 0, 0, 0, 0, 1 }; 5379yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.None, false, false, false, true, true, true, 0, 0, 0, 0, 1 }; 5380yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.None, false, false, false, false, true, true, 0, 0, 0, 0, 1 }; 5381yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.None, false, false, false, false, false, false, 0, 0, 0, 0, 1 }; 5382yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.A, false, false, false, true, false, false, 0, 0, 0, 0, 1 }; 5383yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.A, false, false, false, true, true, true, 0, 0, 0, 0, 1 }; 5384yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.A, false, false, false, false, true, true, 0, 0, 0, 0, 1 }; 5385yield return new object[] { (int)PInvokeCore.WM_SYSCHAR, Keys.A, false, false, false, false, false, false, 0, 0, 0, 0, 1 }; 5387yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.None, false, false, false, false, false, false, 0, 0, 0, 0, 0 }; 5388yield return new object[] { (int)PInvokeCore.WM_KEYUP, Keys.A, false, false, false, false, false, false, 0, 0, 0, 0, 0 }; 5390yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.None, false, false, false, false, false, false, 0, 0, 0, 0, 0 }; 5391yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP, Keys.A, false, false, false, false, false, false, 0, 0, 0, 0, 0 }; 5396public void Control_PreProcessMessage_InvokeWithCustomParent_ReturnsExpected(int windowMsg, Keys keys, bool processCmdKeyResult, bool isInputKeyResult, bool processDialogKeyResult, bool isInputCharResult, bool processDialogCharResult, bool expectedResult, int expectedProcessCmdKeyCallCount, int expectedIsInputKeyCallCount, int expectedProcessDialogKeyCallCount, int expectedIsInputCharCallCount, int expectedProcessDialogCharCallCount) 5399bool processCmdKeyAction(Message actualM, Keys actualKeyData) 5408bool isInputKeyAction(Keys actualKeyData) 5416bool processDialogKeyAction(Keys actualKeyData) 5471public Func<Keys, bool> IsInputKeyAction { get; set; } 5473protected override bool IsInputKey(Keys keyData) => IsInputKeyAction(keyData); 5478public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; } 5480protected override bool ProcessCmdKey(ref Message msg, Keys keyData) => ProcessCmdKeyAction(msg, keyData); 5486public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 5488protected override bool ProcessDialogKey(Keys keyData) => ProcessDialogKeyAction(keyData); 5496[InlineData(Keys.A)] 5497public void Control_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(Keys keyData) 5506[InlineData(Keys.A)] 5507public void Control_ProcessCmdKey_InvokeWithParent_ReturnsFalse(Keys keyData) 5520[InlineData(Keys.A, true)] 5521[InlineData(Keys.A, false)] 5522public void Control_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(Keys keyData, bool result) 5530bool action(Message actualMsg, Keys actualKeyData) 5598[InlineData(Keys.A)] 5599public void Control_ProcessDialogKey_InvokeWithoutParent_ReturnsFalse(Keys keyData) 5607[InlineData(Keys.A)] 5608public void Control_ProcessDialogKey_InvokeWithParent_ReturnsFalse(Keys keyData) 5620[InlineData(Keys.A, true)] 5621[InlineData(Keys.A, false)] 5622public void Control_ProcessDialogKey_InvokeWithCustomParent_ReturnsExpected(Keys keyData, bool result) 5625bool action(Keys actualKeyData)
System\Windows\Forms\ControlTests.Properties.cs (5)
9277keyState[(int)Keys.LButton] = lState; 9278keyState[(int)Keys.MButton] = mState; 9279keyState[(int)Keys.RButton] = rState; 9280keyState[(int)Keys.XButton1] = xState1; 9281keyState[(int)Keys.XButton2] = xState2;
System\Windows\Forms\DataGridViewCellTests.cs (2)
6493cell.OnKeyClick(new KeyEventArgs(Keys.Space), 0); 6501cell.OnKeyClick(new KeyEventArgs(Keys.Space), 0);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (45)
1020yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Right, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1021yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Right, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1022yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Left, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1023yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Left, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1024yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Down, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1025yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Down, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1026yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Up, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1027yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Up, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1028yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Home, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1029yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Home, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1030yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.End, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1031yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.End, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1032yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Prior, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged }; 1033yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Prior, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged }; 1034yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Next, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged }; 1035yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Next, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged }; 1036yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Delete, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1037yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Delete, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1038yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Enter, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1039yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Enter, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1040yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Enter | Keys.Shift | Keys.Control, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1041yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Enter | Keys.Shift | Keys.Control, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1042yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.Enter | Keys.Shift, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || (multiline && acceptsReturn) }; 1043yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.Enter | Keys.Shift, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || (multiline && acceptsReturn) }; 1044yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn, Keys.A, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1045yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn, Keys.A, dataGridViewWantsInputKey, !dataGridViewWantsInputKey }; 1054public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_EditingControlWantsInputKey_InvokeEmpty_ReturnsExpected(RightToLeft rightToLeft, bool valueChanged, bool multiline, bool acceptsReturn, Keys keyData, bool dataGridViewWantsInputKey, bool expected) 1518foreach (IntPtr wParam in new IntPtr[] { (IntPtr)Keys.Enter, (IntPtr)Keys.LineFeed, (IntPtr)Keys.A, 2 }) 1520if (wParam != (IntPtr)Keys.Enter) 1537yield return new object[] { (int)PInvokeCore.WM_CHAR, (IntPtr)Keys.Enter, '2', handled, true, 0, 0, 0, (IntPtr)Keys.Enter }; 1538yield return new object[] { (int)PInvokeCore.WM_CHAR, (IntPtr)Keys.Enter, '1', handled, true, 0, 0, 0, (IntPtr)Keys.Enter }; 2079public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; } 2081protected override bool ProcessCmdKey(ref Message msg, Keys keyData) => ProcessCmdKeyAction(msg, keyData); 2087public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 2089protected override bool ProcessDialogKey(Keys keyData) => ProcessDialogKeyAction(keyData);
System\Windows\Forms\KeyEventArgsTests.cs (35)
12[InlineData(Keys.A)] 13[InlineData(Keys.Control | Keys.A)] 14[InlineData(Keys.Alt | Keys.A)] 15[InlineData(Keys.Shift | Keys.A)] 16[InlineData(Keys.Control)] 17[InlineData(Keys.Alt)] 18[InlineData(Keys.Shift)] 19[InlineData(Keys.Control | Keys.Alt | Keys.Shift | Keys.A)] 20[InlineData((Keys)(-1))] 21[InlineData((Keys)(0x5D))] 22[InlineData((Keys)(0xFF))] 23[InlineData(Keys.Control | Keys.Alt | Keys.Shift | (Keys)(0x5D))] 24public void Ctor_Keys(Keys keyData) 28Assert.Equal((keyData & Keys.Control) == Keys.Control, e.Control); 29Assert.Equal((keyData & Keys.Alt) == Keys.Alt, e.Alt); 30Assert.Equal((keyData & Keys.Shift) == Keys.Shift, e.Shift); 31Assert.Equal((keyData & Keys.Modifiers), e.Modifiers); 32Assert.Equal((int)(keyData & Keys.KeyCode), e.KeyValue); 36if (Enum.IsDefined(typeof(Keys), e.KeyValue)) 38Assert.Equal((Keys)e.KeyValue, e.KeyCode); 42Assert.Equal(Keys.None, e.KeyCode); 51KeyEventArgs e = new(Keys.A) 65KeyEventArgs e = new(Keys.A)
System\Windows\Forms\KeysConverterTests.cs (109)
15[InlineData("Ctrl+Alt+Shift+A", Keys.Control | Keys.Alt | Keys.Shift | Keys.A)] 16[InlineData("Ctrl+Alt+Shift+F1", Keys.Control | Keys.Alt | Keys.Shift | Keys.F1)] 17[InlineData("Ctrl+Alt+D", Keys.Control | Keys.Alt | Keys.D)] 18[InlineData("Ctrl + N", Keys.Control | Keys.N)] 19[InlineData("G", Keys.G)] 20[InlineData("None", Keys.None)] 21public void ConvertFrom_ShouldConvertKeys(string input, Keys keys) 24var result = (Keys)converter.ConvertFrom(input); 29[InlineData(Keys.None, "(none)")] 30[InlineData(Keys.S, "S")] 31[InlineData(Keys.Control | Keys.C, "Ctrl+C")] 32[InlineData(Keys.Control | Keys.Add, "Ctrl+Add")] 33[InlineData(Keys.Control | Keys.Alt | Keys.D, "Ctrl+Alt+D")] 34[InlineData(Keys.Control | Keys.Alt | Keys.Shift | Keys.A, "Ctrl+Alt+Shift+A")] 35[InlineData(Keys.Control | Keys.Alt | Keys.Shift | Keys.F1, "Ctrl+Alt+Shift+F1")] 36[InlineData(Keys.F2 | Keys.Shift | Keys.Alt | Keys.Control, "Ctrl+Alt+Shift+F2")] 37public void ConvertToString_ShouldConvertKeys(Keys keys, string expectedResult) 46yield return new object[] { "fr-FR", Keys.None, new Enum[] { Keys.None } }; 47yield return new object[] { "de-DE", Keys.S, new Enum[] { Keys.S } }; 48yield return new object[] { "zh-CN", Keys.Control | Keys.C, new Enum[] { Keys.Control, Keys.C } }; 49yield return new object[] { "it-IT", Keys.Control | Keys.Add, new Enum[] { Keys.Control, Keys.Add } }; 50yield return new object[] { "ko-KR", Keys.Control | Keys.Alt | Keys.D, new Enum[] { Keys.Control, Keys.Alt, Keys.D } }; 51yield return new object[] { "ru-RU", Keys.Control | Keys.Alt | Keys.Shift | Keys.A, new Enum[] { Keys.Control, Keys.Alt, Keys.Shift, Keys.A } }; 52yield return new object[] { "zh-TW", Keys.Control | Keys.Alt | Keys.Shift | Keys.F1, new Enum[] { Keys.Control, Keys.Alt, Keys.Shift, Keys.F1 } }; 57public void ConvertToEnumArray_ShouldConvertKeys(string cultureName, Keys keys, Enum[] expectedResult) 103Keys[] expectedValues = 105Keys.D0, Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5, Keys.D6, Keys.D7, Keys.D8, Keys.D9, Keys.Alt, Keys.Back, Keys.Control, 106Keys.Delete, Keys.End, Keys.Enter, Keys.F1, Keys.F10, Keys.F11, Keys.F12, Keys.F2, Keys.F3, Keys.F4, Keys.F5, Keys.F6, Keys.F7, Keys.F8, 107Keys.F9, Keys.Home, Keys.Insert, Keys.Next, Keys.PageUp, Keys.Shift
System\Windows\Forms\KeysConverterTests.LocalizationTests.cs (10)
17[InlineData("fr-FR", "toStringNone", Keys.None)] 18[InlineData("zh-CN", "toStringNone", Keys.None)] 19[InlineData("nb-NO", "toStringNone", Keys.None)] 20[InlineData("de-DE", "toStringEnd", Keys.End)] 21public void ConvertFrom_ShouldConvertKeys_Localization(string cultureName, string resourceKey, Keys expectedKey) 36var resultFromSpecificCulture = (Keys?)converter.ConvertFrom(context: null, targetCulture, localizedString); 44var resultFromUICulture = (Keys?)converter.ConvertFrom(context: null, culture: null, localizedString); 55[InlineData("fr-FR", Keys.None, "toStringNone")] 56[InlineData("de-DE", Keys.End, "toStringEnd")] 57public void ConvertToString_ShouldConvertKeys_Localization(string cultureName, Keys key, string resourceKey)
System\Windows\Forms\LabelTests.cs (2)
751KeyEventArgs keyEventArgs = new KeyEventArgs(Keys.A); 773KeyEventArgs keyEventArgs = new KeyEventArgs(Keys.A);
System\Windows\Forms\ListControlTests.cs (10)
2093[InlineData(Keys.Alt, false)] 2094[InlineData(Keys.Alt | Keys.PageUp, false)] 2095[InlineData(Keys.PageUp, true)] 2096[InlineData(Keys.PageDown, true)] 2097[InlineData(Keys.Home, true)] 2098[InlineData(Keys.End, true)] 2099[InlineData(Keys.A, false)] 2100public void IsInputKey_Invoke_ReturnsExpected(Keys keyData, bool expected) 2972public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData);
System\Windows\Forms\ListViewTests.cs (15)
4522KeyboardSimulator.KeyDown(control, Keys.Space); 4529[InlineData(Keys.Down)] 4530[InlineData(Keys.Up)] 4531public unsafe void ListView_WmReflectNotify_LVN_KEYDOWN_WithGroups_WithoutSelection_DoesntFocusGroup(Keys key) 4595var key = key_s == "Keys.Down" ? Keys.Down : Keys.Up; 4609[InlineData(Keys.Down)] 4610[InlineData(Keys.Up)] 4611public unsafe void ListView_VirtualMode_WmReflectNotify_LVN_KEYDOWN_WithGroups_DoesNotFocusGroups(Keys key) 4669KeyboardSimulator.KeyDown(control, Keys.Space); 4681KeyboardSimulator.KeyPress(control, Keys.Enter); 5475[InlineData(Keys.Right)] 5476[InlineData(Keys.Left)] 5477public void ListView_LeftRightArrow_DoesNotThrowException(Keys key)
System\Windows\Forms\MdiControlStripTests.cs (1)
450public new bool ProcessCmdKey(ref Message m, Keys keyData) => base.ProcessCmdKey(ref m, keyData);
System\Windows\Forms\MenuStripTests.cs (26)
682[InlineData(Keys.A)] 683public void MenuStirp_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(Keys keyData) 692[InlineData(Keys.A)] 693[InlineData(Keys.Space)] 694[InlineData(Keys.Control)] 695[InlineData(Keys.Tab)] 696[InlineData(Keys.Control & Keys.Tab)] 697public void MenuStirp_ProcessCmdKey_InvokeWithParent_ReturnsFalse(Keys keyData) 710[InlineData(Keys.A, true)] 711[InlineData(Keys.A, false)] 712[InlineData(Keys.Space, true)] 713[InlineData(Keys.Space, false)] 714[InlineData(Keys.Control, true)] 715[InlineData(Keys.Control, false)] 716[InlineData(Keys.Tab, true)] 717[InlineData(Keys.Tab, false)] 718[InlineData(Keys.Control & Keys.Tab, true)] 719[InlineData(Keys.Control & Keys.Tab, false)] 720public void MenuStirp_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(Keys keyData, bool result) 728bool action(Message actualMsg, Keys actualKeyData) 827public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; } 829protected override bool ProcessCmdKey(ref Message msg, Keys keyData) => ProcessCmdKeyAction(msg, keyData); 946public new bool ProcessCmdKey(ref Message m, Keys keyData) => base.ProcessCmdKey(ref m, keyData);
System\Windows\Forms\PreviewKeyDownEventArgsTests.cs (34)
12[InlineData(Keys.A)] 13[InlineData(Keys.Control | Keys.A)] 14[InlineData(Keys.Alt | Keys.A)] 15[InlineData(Keys.Shift | Keys.A)] 16[InlineData(Keys.Control)] 17[InlineData(Keys.Alt)] 18[InlineData(Keys.Shift)] 19[InlineData(Keys.Control | Keys.Alt | Keys.Shift | Keys.A)] 20[InlineData((Keys)(-1))] 21[InlineData((Keys)(0x5D))] 22[InlineData((Keys)(0xFF))] 23[InlineData(Keys.Control | Keys.Alt | Keys.Shift | (Keys)(0x5D))] 24public void Ctor_Keys(Keys keyData) 28Assert.Equal((keyData & Keys.Control) == Keys.Control, e.Control); 29Assert.Equal((keyData & Keys.Alt) == Keys.Alt, e.Alt); 30Assert.Equal((keyData & Keys.Shift) == Keys.Shift, e.Shift); 31Assert.Equal((keyData & Keys.Modifiers), e.Modifiers); 32Assert.Equal((int)(keyData & Keys.KeyCode), e.KeyValue); 35if (Enum.IsDefined(typeof(Keys), e.KeyValue)) 37Assert.Equal((Keys)e.KeyValue, e.KeyCode); 41Assert.Equal(Keys.None, e.KeyCode); 50PreviewKeyDownEventArgs e = new(Keys.A)
System\Windows\Forms\PrintPreviewDialogTests.cs (13)
11[InlineData(Keys.D1, 1, 1)] 12[InlineData(Keys.D2, 1, 2)] 13[InlineData(Keys.D3, 1, 3)] 14[InlineData(Keys.D4, 2, 2)] 15[InlineData(Keys.D5, 2, 3)] 16public void PrintPreviewDialog_Hotkey_Ctrl_Digit_AddsRowsAndColumns(Keys digitKey, int rows, int columns) 19testPrintPreviewDialog.TestProcessDialogKey(Keys.Control | digitKey); 26[InlineData(Keys.Left)] 27[InlineData(Keys.Right)] 28[InlineData(Keys.Up)] 29[InlineData(Keys.Down)] 30public void PrintPreviewDialog_Hotkey_ArrowKeys_ReturnsFalse(Keys arrowKey) 38internal bool TestProcessDialogKey(Keys keyData)
System\Windows\Forms\PropertyGridTests.cs (2)
3999shortcutKeyEntry.PropertyDescriptor.GetValue(menuItem).Should().Be(Keys.None); 4004bool result = gridViewAccessor.Dynamic.ProcessEnumUpAndDown(shortcutKeyEntry, Keys.Down, closeDropDown: true);
System\Windows\Forms\SendKeysTests.cs (6)
21Assert.Equal(Keys.ControlKey, form.KeyEvents[0].KeyCode); 22Assert.Equal(Keys.A, form.KeyEvents[1].KeyCode); 23Assert.Equal(Keys.Control, form.KeyEvents[1].Modifiers); 24Assert.Equal(Keys.ControlKey, form.KeyEvents[2].KeyCode); 25Assert.Equal(Keys.C, form.KeyEvents[3].KeyCode); 26Assert.Equal(Keys.Control, form.KeyEvents[3].Modifiers);
System\Windows\Forms\SplitterTests.cs (3)
1822yield return new object[] { new KeyEventArgs(Keys.None) }; 1823yield return new object[] { new KeyEventArgs(Keys.Cancel) }; 1824yield return new object[] { new KeyEventArgs(Keys.Escape) };
System\Windows\Forms\TabControlTests.cs (150)
3994yield return new object[] { Keys.Tab, false }; 3995yield return new object[] { Keys.Return, false }; 3996yield return new object[] { Keys.Escape, false }; 3997yield return new object[] { Keys.A, false }; 3998yield return new object[] { Keys.C, false }; 3999yield return new object[] { Keys.Insert, false }; 4000yield return new object[] { Keys.Space, false }; 4001yield return new object[] { Keys.Home, true }; 4002yield return new object[] { Keys.End, true }; 4004yield return new object[] { Keys.Back, false }; 4005yield return new object[] { Keys.Next, true }; 4006yield return new object[] { Keys.Prior, true }; 4007yield return new object[] { Keys.Delete, false }; 4008yield return new object[] { Keys.D0, false }; 4009yield return new object[] { Keys.NumPad0, false }; 4010yield return new object[] { Keys.F1, false }; 4011yield return new object[] { Keys.F2, false }; 4012yield return new object[] { Keys.F3, false }; 4013yield return new object[] { Keys.F4, false }; 4014yield return new object[] { Keys.RButton, false }; 4015yield return new object[] { Keys.PageUp, true }; 4016yield return new object[] { Keys.PageDown, true }; 4017yield return new object[] { Keys.None, false }; 4019yield return new object[] { Keys.Control | Keys.Tab, false }; 4020yield return new object[] { Keys.Control | Keys.Return, false }; 4021yield return new object[] { Keys.Control | Keys.Escape, false }; 4022yield return new object[] { Keys.Control | Keys.A, false }; 4023yield return new object[] { Keys.Control | Keys.C, false }; 4024yield return new object[] { Keys.Control | Keys.Insert, false }; 4025yield return new object[] { Keys.Control | Keys.Space, false }; 4026yield return new object[] { Keys.Control | Keys.Home, true }; 4027yield return new object[] { Keys.Control | Keys.End, true }; 4029yield return new object[] { Keys.Control | Keys.Back, false }; 4030yield return new object[] { Keys.Control | Keys.Next, true }; 4031yield return new object[] { Keys.Control | Keys.Prior, true }; 4032yield return new object[] { Keys.Control | Keys.Delete, false }; 4033yield return new object[] { Keys.Control | Keys.D0, false }; 4034yield return new object[] { Keys.Control | Keys.NumPad0, false }; 4035yield return new object[] { Keys.Control | Keys.F1, false }; 4036yield return new object[] { Keys.Control | Keys.F2, false }; 4037yield return new object[] { Keys.Control | Keys.F3, false }; 4038yield return new object[] { Keys.Control | Keys.F4, false }; 4039yield return new object[] { Keys.Control | Keys.RButton, false }; 4040yield return new object[] { Keys.Control | Keys.PageUp, true }; 4041yield return new object[] { Keys.Control | Keys.PageDown, true }; 4042yield return new object[] { Keys.Control | Keys.None, false }; 4044yield return new object[] { Keys.Alt | Keys.Tab, false }; 4045yield return new object[] { Keys.Alt | Keys.Up, false }; 4046yield return new object[] { Keys.Alt | Keys.Down, false }; 4047yield return new object[] { Keys.Alt | Keys.Left, false }; 4048yield return new object[] { Keys.Alt | Keys.Right, false }; 4049yield return new object[] { Keys.Alt | Keys.Return, false }; 4050yield return new object[] { Keys.Alt | Keys.Escape, false }; 4051yield return new object[] { Keys.Alt | Keys.A, false }; 4052yield return new object[] { Keys.Alt | Keys.C, false }; 4053yield return new object[] { Keys.Alt | Keys.Insert, false }; 4054yield return new object[] { Keys.Alt | Keys.Space, false }; 4055yield return new object[] { Keys.Alt | Keys.Home, false }; 4056yield return new object[] { Keys.Alt | Keys.End, false }; 4058yield return new object[] { Keys.Alt | Keys.Back, false }; 4059yield return new object[] { Keys.Alt | Keys.Next, false }; 4060yield return new object[] { Keys.Alt | Keys.Prior, false }; 4061yield return new object[] { Keys.Alt | Keys.Delete, false }; 4062yield return new object[] { Keys.Alt | Keys.D0, false }; 4063yield return new object[] { Keys.Alt | Keys.NumPad0, false }; 4064yield return new object[] { Keys.Alt | Keys.F1, false }; 4065yield return new object[] { Keys.Alt | Keys.F2, false }; 4066yield return new object[] { Keys.Alt | Keys.F3, false }; 4067yield return new object[] { Keys.Alt | Keys.F4, false }; 4068yield return new object[] { Keys.Alt | Keys.RButton, false }; 4069yield return new object[] { Keys.Alt | Keys.PageUp, false }; 4070yield return new object[] { Keys.Alt | Keys.PageDown, false }; 4071yield return new object[] { Keys.Alt | Keys.None, false }; 4076[InlineData(Keys.Up, false)] 4077[InlineData(Keys.Down, false)] 4078[InlineData(Keys.Left, false)] 4079[InlineData(Keys.Right, false)] 4080[InlineData(Keys.Control | Keys.Up, false)] 4081[InlineData(Keys.Control | Keys.Down, false)] 4082[InlineData(Keys.Control | Keys.Left, false)] 4083[InlineData(Keys.Control | Keys.Right, false)] 4084public void TabControl_IsInputKey_InvokeWithoutHandle_ReturnsExpected(Keys keyData, bool expected) 4093[InlineData(Keys.Up, true)] 4094[InlineData(Keys.Down, true)] 4095[InlineData(Keys.Left, true)] 4096[InlineData(Keys.Right, true)] 4097[InlineData(Keys.Control | Keys.Up, true)] 4098[InlineData(Keys.Control | Keys.Down, true)] 4099[InlineData(Keys.Control | Keys.Left, true)] 4100[InlineData(Keys.Control | Keys.Right, true)] 4101public void TabControl_IsInputKey_InvokeWithHandle_ReturnsExpected(Keys keyData, bool expected) 5820public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData);
System\Windows\Forms\ToolStripButtonTests.cs (11)
1533Assert.True(item.ProcessDialogKey(Keys.Enter)); 1560Assert.True(item.ProcessDialogKey(Keys.Enter)); 1587Assert.True(item.ProcessDialogKey(Keys.Enter)); 1612Assert.True(item.ProcessDialogKey(Keys.Enter)); 1639Assert.True(item.ProcessDialogKey(Keys.Enter)); 1666Assert.True(item.ProcessDialogKey(Keys.Enter)); 1672[InlineData(Keys.A)] 1673[InlineData(Keys.None)] 1674[InlineData((Keys.None - 1))] 1675public void ToolStripButton_ProcessDialogKey_UnknownKey_ReturnsFalse(Keys keyData) 1758public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripControlHostTests.cs (40)
4067c.OnKeyDown(new KeyEventArgs(Keys.A)); 4073c.OnKeyUp(new KeyEventArgs(Keys.A)); 4194[InlineData(Keys.None)] 4195[InlineData(Keys.A)] 4196[InlineData(Keys.Enter)] 4197[InlineData(Keys.Space)] 4198[InlineData((Keys.None - 1))] 4199public void ToolStripControlHost_ProcessCmdKey_Invoke_ReturnsFalse(Keys keyData) 4209[InlineData(Keys.A, true)] 4210[InlineData(Keys.A, false)] 4211public void ToolStripControlHost_ProcessCmdKey_InvokeWithCustomControl_ReturnsFalse(Keys keyData, bool result) 4214bool action(Message actualMsg, Keys actualKeyData) 4235[InlineData(Keys.None)] 4236[InlineData(Keys.A)] 4237[InlineData(Keys.Enter)] 4238[InlineData(Keys.Space)] 4239[InlineData((Keys.None - 1))] 4240public void ToolStripControlHost_ProcessCmdKey_InvokeDisposed_ReturnsFalse(Keys keyData) 4251[InlineData(Keys.None)] 4252[InlineData(Keys.A)] 4253[InlineData(Keys.Enter)] 4254[InlineData(Keys.Space)] 4255[InlineData((Keys.None - 1))] 4256public void ToolStripControlHost_ProcessDialogKey_Invoke_ReturnsFalse(Keys keyData) 4269[InlineData(Keys.A, true)] 4270[InlineData(Keys.A, false)] 4271public void ToolStripControlHost_ProcessDialogKey_InvokeWithCustomControl_ReturnsFalse(Keys keyData, bool result) 4274bool action(Keys actualKeyData) 4295[InlineData(Keys.None)] 4296[InlineData(Keys.A)] 4297[InlineData(Keys.Enter)] 4298[InlineData(Keys.Space)] 4299[InlineData((Keys.None - 1))] 4300public void ToolStripControlHost_ProcessDialogKey_InvokeDisposed_ReturnsFalse(Keys keyData) 4374public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; } 4376protected override bool ProcessCmdKey(ref Message msg, Keys keyData) => ProcessCmdKeyAction(msg, keyData); 4378public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 4380protected override bool ProcessDialogKey(Keys keyData) => ProcessDialogKeyAction(keyData); 4703public new bool ProcessCmdKey(ref Message m, Keys keyData) => base.ProcessCmdKey(ref m, keyData); 4705public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
5236public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripItemTests.cs (24)
10358[InlineData(Keys.None)] 10359[InlineData(Keys.A)] 10360[InlineData(Keys.Enter)] 10361[InlineData(Keys.Space)] 10362[InlineData((Keys.None - 1))] 10363public void ToolStripItem_IsInputKey_Invoke_ReturnsFalse(Keys keyData) 13947[InlineData(Keys.None)] 13948[InlineData(Keys.A)] 13949[InlineData(Keys.Enter)] 13950[InlineData(Keys.Space)] 13951[InlineData((Keys.None - 1))] 13952public void ToolStripItem_ProcessCmdKey_Invoke_ReturnsFalse(Keys keyData) 13979Assert.True(item.ProcessDialogKey(Keys.Enter)); 14006Assert.True(item.ProcessDialogKey(Keys.Enter)); 14033Assert.True(item.ProcessDialogKey(Keys.Enter)); 14039[InlineData(Keys.Space)] 14040[InlineData(Keys.A)] 14041[InlineData(Keys.None)] 14042[InlineData((Keys.None - 1))] 14043public void ToolStripItem_ProcessDialogKey_UnknownKey_ReturnsFalse(Keys keyData) 15482public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData); 15531public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData); 15601public new bool ProcessCmdKey(ref Message m, Keys keyData) => base.ProcessCmdKey(ref m, keyData); 15603public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripMenuItemTests.cs (33)
87Assert.Equal(Keys.None, item.ShortcutKeys); 122[InlineData(Keys.F1)] 123[InlineData(Keys.None)] 124[InlineData(Keys.Control | Keys.Add)] 125[InlineData(Keys.Control | Keys.Alt | Keys.D)] 126[InlineData(Keys.Control | Keys.Alt | Keys.Shift | Keys.A)] 127[InlineData(Keys.Control | Keys.Alt | Keys.Shift | Keys.F1)] 128public void ToolStripMenuItem_SetShortcutKeys(Keys keys) 136[InlineData(Keys.A)] 137[InlineData(Keys.Control)] 138[InlineData(Keys.Control | Keys.Alt)] 139[InlineData(Keys.Control | Keys.Alt | Keys.Shift)] 140public void ToolStripMenuItem_SetShortcutKeys_ThrowsInvalidEnumArgumentException(Keys keys) 156item.ShortcutKeys = Keys.Control | Keys.Shift | Keys.K; 226Keys shortcutKeys = Keys.Control | Keys.A; 297ShortcutKeys = Keys.Control | Keys.A,
System\Windows\Forms\ToolStripTests.cs (35)
4820toolStrip.TestAccessor().Dynamic.LastKeyData = Keys.Tab; 4841toolStrip.TestAccessor().Dynamic.LastKeyData = Keys.Tab; 4866toolStrip.TestAccessor().Dynamic.LastKeyData = Keys.Shift | Keys.Tab; 4887toolStrip.TestAccessor().Dynamic.LastKeyData = Keys.Shift | Keys.Tab; 6904[InlineData(Keys.A)] 6905public void ToolStrip_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(Keys keyData) 6914[InlineData(Keys.A)] 6915[InlineData(Keys.Space)] 6916[InlineData(Keys.Control)] 6917[InlineData(Keys.Tab)] 6918[InlineData(Keys.Control & Keys.Tab)] 6919public void ToolStrip_ProcessCmdKey_InvokeWithParent_ReturnsFalse(Keys keyData) 6932[InlineData(Keys.A, true)] 6933[InlineData(Keys.A, false)] 6934[InlineData(Keys.Space, true)] 6935[InlineData(Keys.Space, false)] 6936[InlineData(Keys.Control, true)] 6937[InlineData(Keys.Control, false)] 6938[InlineData(Keys.Tab, true)] 6939[InlineData(Keys.Tab, false)] 6940[InlineData(Keys.Control & Keys.Tab, true)] 6941[InlineData(Keys.Control & Keys.Tab, false)] 6942public void ToolStrip_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(Keys keyData, bool result) 6950bool action(Message actualMsg, Keys actualKeyData) 7299toolStrip.TestAccessor().Dynamic.LastKeyData = Keys.Left; 7441public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; } 7443protected override bool ProcessCmdKey(ref Message msg, Keys keyData) => ProcessCmdKeyAction(msg, keyData); 7591public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData); 7647public new bool ProcessCmdKey(ref Message m, Keys keyData) => base.ProcessCmdKey(ref m, keyData); 7649public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\TreeViewTests.cs (26)
5732yield return new object[] { new KeyEventArgs(Keys.None) }; 5733yield return new object[] { new KeyEventArgs(Keys.A) }; 5734yield return new object[] { new KeyEventArgs(Keys.Space) }; 5735yield return new object[] { new KeyEventArgs(Keys.Control | Keys.Space) }; 5764yield return new object[] { false, true, false, new KeyEventArgs(Keys.None), 0, 0, false }; 5765yield return new object[] { false, true, false, new KeyEventArgs(Keys.A), 0, 0, false }; 5766yield return new object[] { false, true, false, new KeyEventArgs(Keys.Space), 1, 1, true }; 5767yield return new object[] { false, true, true, new KeyEventArgs(Keys.Space), 1, 0, true }; 5768yield return new object[] { false, true, false, new KeyEventArgs(Keys.Control | Keys.Space), 1, 1, true }; 5769yield return new object[] { false, true, true, new KeyEventArgs(Keys.Control | Keys.Space), 1, 0, true }; 5771yield return new object[] { true, true, false, new KeyEventArgs(Keys.Space), 0, 0, true }; 5772yield return new object[] { true, false, false, new KeyEventArgs(Keys.Space), 0, 0, true }; 5773yield return new object[] { false, false, false, new KeyEventArgs(Keys.Space), 0, 0, false }; 5897yield return new object[] { true, new KeyEventArgs(Keys.None), true }; 5898yield return new object[] { true, new KeyEventArgs(Keys.A), true }; 5899yield return new object[] { true, new KeyEventArgs(Keys.Space), true }; 5900yield return new object[] { true, new KeyEventArgs(Keys.Control | Keys.Space), true }; 5902yield return new object[] { false, new KeyEventArgs(Keys.None), false }; 5903yield return new object[] { false, new KeyEventArgs(Keys.A), false }; 5904yield return new object[] { false, new KeyEventArgs(Keys.Space), true }; 5905yield return new object[] { false, new KeyEventArgs(Keys.Control | Keys.Space), true };
System\Windows\Forms\UpDownBaseTests.cs (12)
2359yield return new object[] { true, userEdit, source, new KeyEventArgs(Keys.A), 0, 0, 0, false }; 2360yield return new object[] { false, userEdit, source, new KeyEventArgs(Keys.A), 0, 0, 0, false }; 2361yield return new object[] { true, userEdit, source, new KeyEventArgs(Keys.Up), 1, 0, 0, true }; 2362yield return new object[] { false, userEdit, source, new KeyEventArgs(Keys.Up), 0, 0, 0, false }; 2363yield return new object[] { true, userEdit, source, new KeyEventArgs(Keys.Down), 0, 1, 0, true }; 2364yield return new object[] { false, userEdit, source, new KeyEventArgs(Keys.Down), 0, 0, 0, false }; 2365yield return new object[] { true, userEdit, source, new KeyEventArgs(Keys.Left), 0, 0, 0, false }; 2366yield return new object[] { false, userEdit, source, new KeyEventArgs(Keys.Left), 0, 0, 0, false }; 2367yield return new object[] { true, userEdit, source, new KeyEventArgs(Keys.Right), 0, 0, 0, false }; 2368yield return new object[] { false, userEdit, source, new KeyEventArgs(Keys.Right), 0, 0, 0, false }; 2373yield return new object[] { interceptArrowKeys, true, source, new KeyEventArgs(Keys.Return), 0, 0, 1, false }; 2374yield return new object[] { interceptArrowKeys, false, source, new KeyEventArgs(Keys.Return), 0, 0, 0, false };
TextBoxBaseTests.cs (189)
5187yield return new object[] { multiline, acceptsTab, readOnly, Keys.Tab, multiline && acceptsTab }; 5188yield return new object[] { multiline, acceptsTab, readOnly, Keys.Tab | Keys.Control, false }; 5189yield return new object[] { multiline, acceptsTab, readOnly, Keys.Tab | Keys.Alt, false }; 5190yield return new object[] { multiline, acceptsTab, readOnly, Keys.Escape, false }; 5191yield return new object[] { multiline, acceptsTab, readOnly, Keys.Escape | Keys.Alt, false }; 5192yield return new object[] { multiline, acceptsTab, readOnly, Keys.Back | Keys.Alt, false }; 5193yield return new object[] { multiline, acceptsTab, readOnly, Keys.PageUp, true }; 5194yield return new object[] { multiline, acceptsTab, readOnly, Keys.PageUp | Keys.Alt, false }; 5195yield return new object[] { multiline, acceptsTab, readOnly, Keys.PageDown, true }; 5196yield return new object[] { multiline, acceptsTab, readOnly, Keys.PageDown | Keys.Alt, false }; 5197yield return new object[] { multiline, acceptsTab, readOnly, Keys.Home, true }; 5198yield return new object[] { multiline, acceptsTab, readOnly, Keys.Home | Keys.Alt, false }; 5199yield return new object[] { multiline, acceptsTab, readOnly, Keys.End, true }; 5200yield return new object[] { multiline, acceptsTab, readOnly, Keys.End | Keys.Alt, false }; 5208[InlineData(true, true, true, Keys.A, false)] 5209[InlineData(true, true, true, Keys.Back, false)] 5210[InlineData(true, true, false, Keys.Back, true)] 5211[InlineData(true, true, true, Keys.Left, false)] 5212[InlineData(true, true, false, Keys.Left, false)] 5213[InlineData(true, true, true, Keys.Right, false)] 5214[InlineData(true, true, false, Keys.Right, false)] 5215[InlineData(true, true, true, Keys.Up, false)] 5216[InlineData(true, true, false, Keys.Up, false)] 5217[InlineData(false, true, true, Keys.Up, false)] 5218[InlineData(false, true, false, Keys.Up, false)] 5219[InlineData(true, true, true, Keys.Down, false)] 5220[InlineData(true, true, false, Keys.Down, false)] 5221[InlineData(false, true, true, Keys.Down, false)] 5222[InlineData(false, true, false, Keys.Down, false)] 5223[InlineData(false, true, true, Keys.Down | Keys.Alt, false)] 5224[InlineData(false, true, false, Keys.Down | Keys.Alt, false)] 5225public void TextBoxBase_IsInputKey_Invoke_ReturnsExpected(bool multiline, bool acceptsTab, bool readOnly, Keys keyData, bool expected) 5239[InlineData(true, true, true, Keys.A, true)] 5240[InlineData(true, true, true, Keys.Back, true)] 5241[InlineData(true, true, false, Keys.Back, true)] 5242[InlineData(true, true, true, Keys.Left, true)] 5243[InlineData(true, true, false, Keys.Left, true)] 5244[InlineData(true, true, true, Keys.Right, true)] 5245[InlineData(true, true, false, Keys.Right, true)] 5246[InlineData(true, true, true, Keys.Up, true)] 5247[InlineData(true, true, false, Keys.Up, true)] 5248[InlineData(false, true, true, Keys.Up, true)] 5249[InlineData(false, true, false, Keys.Up, true)] 5250[InlineData(true, true, true, Keys.Down, true)] 5251[InlineData(true, true, false, Keys.Down, true)] 5252[InlineData(false, true, true, Keys.Down, true)] 5253[InlineData(false, true, false, Keys.Down, true)] 5254[InlineData(false, true, true, Keys.Down | Keys.Alt, false)] 5255[InlineData(false, true, false, Keys.Down | Keys.Alt, false)] 5256public void TextBoxBase_IsInputKey_InvokeWithHandle_ReturnsExpected(bool multiline, bool acceptsTab, bool readOnly, Keys keyData, bool expected) 5810yield return new object[] { shortcutsEnabled, readOnly, Keys.None, false }; 5811yield return new object[] { shortcutsEnabled, readOnly, Keys.A, false }; 5813yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlZ, !shortcutsEnabled }; 5814yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlC, !shortcutsEnabled }; 5815yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlX, !shortcutsEnabled }; 5816yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlV, !shortcutsEnabled }; 5817yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlA, true }; 5818yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlL, !shortcutsEnabled || readOnly }; 5819yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlR, !shortcutsEnabled || readOnly }; 5820yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlE, !shortcutsEnabled || readOnly }; 5821yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlY, !shortcutsEnabled }; 5822yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlDel, !shortcutsEnabled }; 5823yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.ShiftDel, !shortcutsEnabled }; 5824yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.ShiftIns, !shortcutsEnabled }; 5825yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlJ, !shortcutsEnabled || readOnly }; 5827yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlZ | Keys.Shift, !shortcutsEnabled }; 5828yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlC | Keys.Shift, !shortcutsEnabled }; 5829yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlX | Keys.Shift, !shortcutsEnabled }; 5830yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlV | Keys.Shift, !shortcutsEnabled }; 5831yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlA | Keys.Shift, !shortcutsEnabled }; 5832yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlL | Keys.Shift, !shortcutsEnabled }; 5833yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlR | Keys.Shift, !shortcutsEnabled }; 5834yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlE | Keys.Shift, !shortcutsEnabled }; 5835yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlY | Keys.Shift, !shortcutsEnabled }; 5836yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlDel | Keys.Shift, !shortcutsEnabled }; 5837yield return new object[] { shortcutsEnabled, readOnly, (Keys)Shortcut.CtrlJ | Keys.Shift, !shortcutsEnabled }; 5839yield return new object[] { shortcutsEnabled, readOnly, Keys.Control | Keys.Back, !shortcutsEnabled || !readOnly }; 5840yield return new object[] { shortcutsEnabled, readOnly, Keys.Control | Keys.Shift | Keys.Back, !shortcutsEnabled || !readOnly }; 5847public void TextBoxBase_ProcessCmdKey_Invoke_ReturnsExpected(bool shortcutsEnabled, bool readOnly, Keys keyData, bool expected) 5861public void TextBoxBase_ProcessCmdKey_InvokeWithParent_ReturnsFalse(bool shortcutsEnabled, bool readOnly, Keys keyData, bool expected) 5876[InlineData(Keys.A)] 5877public void TextBoxBase_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(Keys keyData) 5886[InlineData(true, false, (Keys)Shortcut.CtrlA, true, true)] 5887[InlineData(true, false, (Keys)Shortcut.CtrlA, false, true)] 5888[InlineData(false, false, (Keys)Shortcut.CtrlA, true, true)] 5889[InlineData(false, false, (Keys)Shortcut.CtrlA, false, true)] 5890[InlineData(true, true, (Keys)Shortcut.CtrlL, true, true)] 5891[InlineData(true, true, (Keys)Shortcut.CtrlL, false, true)] 5892[InlineData(true, false, (Keys)Shortcut.CtrlL, true, true)] 5893[InlineData(true, false, (Keys)Shortcut.CtrlL, false, false)] 5894[InlineData(true, false, Keys.A, true, true)] 5895[InlineData(true, false, Keys.A, false, false)] 5896public void TextBoxBase_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(bool shortcutsEnabled, bool readOnly, Keys keyData, bool result, bool expected) 5908bool action(Message actualMsg, Keys actualKeyData) 5929public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; } 5931protected override bool ProcessCmdKey(ref Message msg, Keys keyData) => ProcessCmdKeyAction(msg, keyData); 5933public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 5935protected override bool ProcessDialogKey(Keys keyData) => ProcessDialogKeyAction(keyData); 5944Assert.True(control.ProcessCmdKey(ref message, Keys.Control | Keys.Back)); 5958Assert.False(control.ProcessCmdKey(ref message, Keys.Control | Keys.Back)); 5973Assert.True(control.ProcessCmdKey(ref message, Keys.Control | Keys.Back)); 5991Assert.True(control.ProcessCmdKey(ref message, Keys.Control | Keys.Back)); 6008Assert.True(control.ProcessCmdKey(ref message, Keys.Control | Keys.Back)); 6013[InlineData(true, Keys.A)] 6014[InlineData(false, Keys.A)] 6015[InlineData(true, Keys.Tab)] 6016[InlineData(false, Keys.Tab)] 6017[InlineData(true, Keys.Control | Keys.Tab)] 6018[InlineData(false, Keys.Control | Keys.Tab)] 6019[InlineData(true, Keys.Control | Keys.A)] 6020[InlineData(false, Keys.Control | Keys.A)] 6021public void TextBox_ProcessDialogKey_InvokeWithoutParent_ReturnsFalse(bool acceptsTab, Keys keyData) 6032[InlineData(true, Keys.A)] 6033[InlineData(false, Keys.A)] 6034[InlineData(true, Keys.Tab)] 6035[InlineData(false, Keys.Tab)] 6036[InlineData(true, Keys.Control | Keys.Tab)] 6037[InlineData(false, Keys.Control | Keys.Tab)] 6038[InlineData(true, Keys.Control | Keys.A)] 6039[InlineData(false, Keys.Control | Keys.A)] 6040public void TextBox_ProcessDialogKey_InvokeWithParent_ReturnsFalse(bool acceptsTab, Keys keyData) 6053[InlineData(true, Keys.A, Keys.A, true)] 6054[InlineData(false, Keys.A, Keys.A, false)] 6055[InlineData(true, Keys.Tab, Keys.Tab, true)] 6056[InlineData(false, Keys.Tab, Keys.Tab, false)] 6057[InlineData(true, Keys.Control | Keys.Tab, Keys.Tab, true)] 6058[InlineData(false, Keys.Control | Keys.Tab, Keys.Control | Keys.Tab, false)] 6059[InlineData(true, Keys.Control | Keys.A, Keys.Control | Keys.A, true)] 6060[InlineData(false, Keys.Control | Keys.A, Keys.Control | Keys.A, false)] 6061public void TextBox_ProcessDialogKey_InvokeWithCustomParent_ReturnsExpected(bool acceptsTab, Keys keyData, Keys expectedKeyData, bool result) 6064bool action(Keys actualKeyData) 7745public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData); 7777public new bool ProcessCmdKey(ref Message m, Keys keyData) => base.ProcessCmdKey(ref m, keyData); 7779public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
TrackBarTests.cs (10)
2311[InlineData(Keys.Alt, false)] 2312[InlineData(Keys.Alt | Keys.PageUp, false)] 2313[InlineData(Keys.PageUp, true)] 2314[InlineData(Keys.PageDown, true)] 2315[InlineData(Keys.Home, true)] 2316[InlineData(Keys.End, true)] 2317[InlineData(Keys.A, false)] 2318public void TrackBar_IsInputKey_Invoke_ReturnsExpected(Keys keyData, bool expected) 3340public new bool IsInputKey(Keys keyData) => base.IsInputKey(keyData);
WebBrowserBaseTests.cs (13)
802[InlineData(Keys.A)] 803public void WebBrowserBase_ProcessDialogKey_InvokeWithoutParent_ReturnsFalse(Keys keyData) 811[InlineData(Keys.A)] 812public void WebBrowserBase_ProcessDialogKey_InvokeWithParent_ReturnsFalse(Keys keyData) 827[InlineData(Keys.A, true)] 828[InlineData(Keys.A, false)] 829public void WebBrowserBase_ProcessDialogKey_InvokeWithCustomParent_ReturnsExpected(Keys keyData, bool result) 832bool action(Keys actualKeyData) 863public Func<Message, Keys, bool> ProcessCmdKeyAction { get; set; } 865protected override bool ProcessCmdKey(ref Message msg, Keys keyData) => ProcessCmdKeyAction(msg, keyData); 871public Func<Keys, bool> ProcessDialogKeyAction { get; set; } 873protected override bool ProcessDialogKey(Keys keyData) => ProcessDialogKeyAction(keyData); 952public new bool ProcessDialogKey(Keys keyData) => base.ProcessDialogKey(keyData);
System.Windows.Forms.TestUtilities (5)
CommonTestHelperEx.cs (2)
124new(Keys.None), 125new(Keys.Cancel)
KeyboardSimulator.cs (3)
12public static void KeyDown(Control control, Keys key) 18public static void KeyPress(Control control, Keys key) 25private static (nint keyCode, nint lParam) GetKeyParameters(Keys key)
System.Windows.Forms.UI.IntegrationTests (3)
MenuStripTests.cs (3)
27toolStripMenuItem1.ProcessCmdKey(ref message, keyData: Keys.Enter); 29toolStripMenuItem2.ProcessCmdKey(ref message, keyData: Keys.Space); 32toolStripMenuItem3.ProcessCmdKey(ref message, keyData: Keys.Enter);
TestPassApp (18)
Menu_Toolbars_controls.Designer.cs (18)
167newToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.N; 176openToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.O; 190saveToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.S; 210printToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.P; 244undoToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Z; 251redoToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Y; 265cutToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.X; 274copyToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C; 283pasteToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.V;
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) 461_hostContainerInternal.ProcessingTabKeyFromElementHost = (keyData & SWF.Keys.Tab) == SWF.Keys.Tab;
System\Windows\Integration\WindowsFormsHost.cs (18)
902protected override bool ProcessDialogKey(Keys keyData) 907if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) 909Keys keyCode = (Keys)keyData & Keys.KeyCode; 910if (keyCode == Keys.Tab || keyCode == Keys.Left || 911keyCode == Keys.Right || keyCode == Keys.Up || 912keyCode == Keys.Down) 919if ((keyCode == Keys.Left || keyCode == Keys.Right || keyCode == Keys.Down || keyCode == Keys.Up) 923return c.SelectNextControl(this.ActiveControl, keyCode == Keys.Right || keyCode == Keys.Down, false, false, false);
WinFormsControlsTest (10)
MenuStripAndCheckedListBox.Designer.cs (9)
97this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); 105this.openToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); 231this.uncheckedCheckOnClickToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
RichTextBoxes.cs (1)
96if (e.Control && e.KeyCode == Keys.F)