3327 references to Keys
Accessibility_Core_App (18)
Menu_Toolbars_controls.Designer.cs (18)
167
newToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.N;
176
openToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.O;
190
saveToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.S;
210
printToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.P;
244
undoToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.Z;
251
redoToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.Y;
265
cutToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.X;
274
copyToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.C;
283
pasteToolStripMenuItem.ShortcutKeys =
Keys
.Control |
Keys
.V;
DesignSurface (19)
MainForm.Designer.cs (19)
193
this.ToolStripMenuItemUnDo.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.Z)));
201
this.ToolStripMenuItemReDo.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.Y)));
216
this.ToolStripMenuItemCut.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.X)));
226
this.ToolStripMenuItemCopy.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.C)));
236
this.ToolStripMenuItemPaste.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.V)));
244
this.ToolStripMenuItemDelete.ShortcutKeys = System.Windows.Forms.
Keys
.Delete;
252
this.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)
21
Dim keys As
Keys
= Control.ModifierKeys
22
Return CType(keys And
Keys
.Alt, Boolean)
36
Return CType(UnsafeNativeMethods.GetKeyState(
Keys
.CapsLock) And 1, Boolean)
46
Dim keys As
Keys
= Control.ModifierKeys
47
Return CType(keys And
Keys
.Control, Boolean)
61
Return CType(UnsafeNativeMethods.GetKeyState(
Keys
.NumLock) And 1, Boolean)
75
Return CType(UnsafeNativeMethods.GetKeyState(
Keys
.Scroll) And 1, Boolean)
85
Dim keys As
Keys
= Control.ModifierKeys
86
Return CType(keys And
Keys
.Shift, Boolean)
System.Windows.Forms (1607)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1640
protected override bool ProcessDialogKey(
Keys
keyData) => !_ignoreDialogKeys && base.ProcessDialogKey(keyData);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
379
target.SelectNextControl(null, ModifierKeys !=
Keys
.Shift, tabStopOnly: true, nested: true, wrap: true);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (2)
41
if (IsInputKey(
Keys
.Return))
46
if (IsInputKey(
Keys
.Escape))
System\Windows\Forms\Control.cs (69)
2397
private protected static
Keys
LastKeyData { get; set; }
2509
public static
Keys
ModifierKeys
2513
Keys
modifiers = 0;
2515
if (PInvoke.GetKeyState((int)
Keys
.ShiftKey) < 0)
2517
modifiers |=
Keys
.Shift;
2520
if (PInvoke.GetKeyState((int)
Keys
.ControlKey) < 0)
2522
modifiers |=
Keys
.Control;
2525
if (PInvoke.GetKeyState((int)
Keys
.Menu) < 0)
2527
modifiers |=
Keys
.Alt;
2544
if (PInvoke.GetKeyState((int)
Keys
.LButton) < 0)
2549
if (PInvoke.GetKeyState((int)
Keys
.RButton) < 0)
2554
if (PInvoke.GetKeyState((int)
Keys
.MButton) < 0)
2559
if (PInvoke.GetKeyState((int)
Keys
.XButton1) < 0)
2564
if (PInvoke.GetKeyState((int)
Keys
.XButton2) < 0)
6204
public static bool IsKeyLocked(
Keys
keyVal)
6206
if (keyVal is
Keys
.Insert or
Keys
.NumLock or
Keys
.CapsLock or
Keys
.Scroll)
6217
return keyVal is
Keys
.Insert or
Keys
.CapsLock ? (result & 0x1) != 0x0 : (result & 0x8001) != 0x0;
6241
int mask = charCode == (char)(int)
Keys
.Tab
6261
protected virtual bool IsInputKey(
Keys
keyData)
6263
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
6269
switch (keyData &
Keys
.KeyCode)
6271
case
Keys
.Tab:
6274
case
Keys
.Left:
6275
case
Keys
.Right:
6276
case
Keys
.Up:
6277
case
Keys
.Down:
7657
&& (e.KeyCode.HasFlag(
Keys
.ControlKey) || e.KeyCode ==
Keys
.Escape))
8530
/// For WM_KEYDOWN and WM_SYSKEYDOWN messages, this first calls <see cref="ProcessCmdKey(ref Message,
Keys
)"/>
8532
/// <see cref="IsInputKey(
Keys
)"/> is called to check whether the key message represents an input key for the
8533
/// control. Finally, if <see cref="IsInputKey(
Keys
)"/> indicates that the control isn't interested in the key
8534
/// message, then <see cref="ProcessDialogKey(
Keys
)"/> is called to check for dialog keys such as TAB, arrow
8554
/// <see cref="IsInputKey(
Keys
)"/>, <see cref="ProcessCmdKey(ref Message,
Keys
)"/>, <see cref="ProcessDialogChar(char)"/>,
8555
/// or <see cref="ProcessDialogKey(
Keys
)"/>) instead of overriding this method.
8569
Keys
keyData = (
Keys
)(nint)msg.WParamInternal | ModifierKeys;
8637
Keys
keyData = (
Keys
)(nint)message.WParamInternal | ModifierKeys;
8701
/// If the control has a parent, the key is passed to the parent's <see cref="ProcessCmdKey(ref Message,
Keys
)"/>
8707
protected virtual bool ProcessCmdKey(ref Message msg,
Keys
keyData) =>
8822
/// arrow keys. This method is called only if the <see cref="IsInputKey(
Keys
)"/> method indicates that the control
8823
/// is not processing the key. The <see cref="ProcessDialogKey(
Keys
)"/> simply sends the character to the parent's
8824
/// <see cref="ProcessDialogKey(
Keys
)"/> method, or returns <see langword="false"/> if the control has no parent.
8828
protected virtual bool ProcessDialogKey(
Keys
keyData) => _parent?.ProcessDialogKey(keyData) ?? false;
8882
ke = new KeyEventArgs((
Keys
)(int)m.WParamInternal | ModifierKeys);
8964
Keys
keyCode = (
Keys
)(nint)msg.WParamInternal &
Keys
.KeyCode;
8966
if (keyCode is not
Keys
.F10 and not
Keys
.Menu and not
Keys
.Tab)
8990
if (keyCode is
Keys
.F10 or
Keys
.Menu)
8999
if (keyCode ==
Keys
.Tab)
12805
static bool IsKeyDown(
Keys
key, ReadOnlySpan<byte> stateArray)
12813
return IsKeyDown(
Keys
.Tab, stateArray)
12814
|| IsKeyDown(
Keys
.Up, stateArray)
12815
|| IsKeyDown(
Keys
.Down, stateArray)
12816
|| IsKeyDown(
Keys
.Left, stateArray)
12817
|| IsKeyDown(
Keys
.Right, stateArray)
12819
|| IsKeyDown(
Keys
.Menu, stateArray)
12820
|| IsKeyDown(
Keys
.F10, stateArray)
12821
|| 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)
1120
if (kevent.KeyData ==
Keys
.Space)
1163
if (kevent.KeyCode is
Keys
.Enter or
Keys
.Space)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
371
if (PInvoke.GetKeyState((int)
Keys
.Tab) >= 0)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (33)
1442
if (keyChar == (char)(int)
Keys
.Escape)
1446
else if (keyChar == (char)(int)
Keys
.Return && DroppedDown)
2020
Debug.Assert((ModifierKeys &
Keys
.Alt) == 0);
2023
if ((
Keys
)(int)m.WParamInternal ==
Keys
.Delete)
2038
Debug.Assert((ModifierKeys &
Keys
.Alt) == 0);
2040
if (keyChar == (char)
Keys
.Back)
2062
else if (keyChar == (char)
Keys
.Escape)
2068
if (keyChar != (char)
Keys
.Escape && keyChar != (char)
Keys
.Return && !DroppedDown
2134
protected override bool IsInputKey(
Keys
keyData)
2136
Keys
keyCode = keyData & (
Keys
.KeyCode |
Keys
.Alt);
2137
if (keyCode is
Keys
.Return or
Keys
.Escape)
2441
if (e.KeyCode ==
Keys
.Return)
2446
else if ((e.KeyCode ==
Keys
.Escape) && _autoCompleteDroppedDown)
2468
if (!e.Handled && (e.KeyChar == (char)(int)
Keys
.Return || e.KeyChar == (char)(int)
Keys
.Escape)
2497
private static bool ContainsNavigationKeyCode(
Keys
keyCode) => keyCode switch
2499
Keys
.Home or
Keys
.End or
Keys
.Left or
Keys
.Right => true,
2925
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
2929
if (!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)
10068
protected override bool IsInputKey(
Keys
keyData)
10070
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
10075
switch (keyData &
Keys
.KeyCode)
10077
case
Keys
.Escape:
10082
case
Keys
.Tab:
10084
return GetTabKeyEffective((keyData &
Keys
.Shift) ==
Keys
.Shift, (keyData &
Keys
.Control) ==
Keys
.Control);
10087
case
Keys
.A:
10089
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Control)
10097
case
Keys
.C:
10098
case
Keys
.Insert:
10100
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Control)
10108
case
Keys
.Space:
10110
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift
10121
case
Keys
.Up:
10122
case
Keys
.Down:
10123
case
Keys
.Left:
10124
case
Keys
.Right:
10125
case
Keys
.Home:
10126
case
Keys
.End:
10127
case
Keys
.Next:
10128
case
Keys
.Prior:
10129
case
Keys
.Enter:
10130
case
Keys
.Delete:
10131
case
Keys
.D0:
10132
case
Keys
.NumPad0:
10133
case
Keys
.F2:
10134
case
Keys
.F3:
11898
Keys
nModifier = ModifierKeys;
11899
bool isControlDown = (nModifier &
Keys
.Control) ==
Keys
.Control && (nModifier &
Keys
.Alt) == 0;
11900
bool isShiftDown = (nModifier &
Keys
.Shift) ==
Keys
.Shift;
11901
bool isAltDown = (nModifier &
Keys
.Alt) ==
Keys
.Alt;
15700
switch (e.KeyData &
Keys
.KeyCode)
15702
case
Keys
.A:
15703
case
Keys
.C:
15704
case
Keys
.D0:
15705
case
Keys
.NumPad0:
15706
case
Keys
.Delete:
15707
case
Keys
.Down:
15708
case
Keys
.F2:
15709
case
Keys
.F3:
15710
case
Keys
.F10:
15711
case
Keys
.End:
15712
case
Keys
.Enter:
15713
case
Keys
.Escape:
15714
case
Keys
.Home:
15715
case
Keys
.Insert:
15716
case
Keys
.Left:
15717
case
Keys
.Next:
15718
case
Keys
.Prior:
15719
case
Keys
.Right:
15720
case
Keys
.Space:
15721
case
Keys
.Tab:
15722
case
Keys
.Up:
15767
if (_dataGridViewOper[OperationTrackKeyboardColResize] && (e.KeyData &
Keys
.Alt) !=
Keys
.Alt)
16463
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
16468
bool verticalScroll = ((ModifierKeys &
Keys
.Control) == 0);
19925
protected bool ProcessAKey(
Keys
keyData)
19927
if ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) ==
Keys
.Control && MultiSelect)
19936
protected bool ProcessDeleteKey(
Keys
keyData)
20063
protected override bool ProcessDialogKey(
Keys
keyData)
20065
Keys
key = (keyData &
Keys
.KeyCode);
20067
if (key ==
Keys
.Enter)
20074
else if (key ==
Keys
.Escape)
20096
else if (key is
Keys
.D0 or
Keys
.NumPad0)
20103
else if (key is
Keys
.C or
Keys
.Insert)
20110
else if (key ==
Keys
.Tab)
20137
keyData &= ~
Keys
.Control;
20154
protected bool ProcessDownKey(
Keys
keyData) => ProcessDownKeyInternal(keyData, out bool _);
20156
private bool ProcessDownKeyInternal(
Keys
keyData, out bool moved)
20183
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20185
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20308
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20436
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20438
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20550
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20672
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20674
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20820
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20980
if ((keyData &
Keys
.Control) ==
Keys
.Control)
21078
protected bool ProcessEndKey(
Keys
keyData)
21097
if ((keyData &
Keys
.Control) == 0)
21099
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21113
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21146
if ((keyData &
Keys
.Control) == 0)
21148
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21162
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21223
if ((keyData &
Keys
.Control) == 0)
21225
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21240
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21263
if ((keyData &
Keys
.Control) == 0)
21265
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21269
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21354
if ((keyData &
Keys
.Control) == 0)
21356
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21371
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21407
protected bool ProcessEnterKey(
Keys
keyData)
21414
if ((keyData &
Keys
.Control) == 0)
21418
keyData &= ~
Keys
.Shift;
21489
protected bool ProcessEscapeKey(
Keys
keyData)
21508
protected bool ProcessF2Key(
Keys
keyData)
21537
protected bool ProcessF3Key(
Keys
keyData)
21555
protected bool ProcessHomeKey(
Keys
keyData)
21571
if ((keyData &
Keys
.Control) == 0)
21573
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21587
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21620
if ((keyData &
Keys
.Control) == 0)
21622
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21636
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21697
if ((keyData &
Keys
.Control) == 0)
21699
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21714
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21742
if ((keyData &
Keys
.Control) == 0)
21744
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21748
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21833
if ((keyData &
Keys
.Control) == 0)
21835
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21865
protected bool ProcessInsertKey(
Keys
keyData)
21867
if (((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) ==
Keys
.Control
21868
|| ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) == (
Keys
.Control |
Keys
.Shift)
21869
&& (keyData &
Keys
.KeyCode) ==
Keys
.C))
21897
KeyEventArgs ke = new((
Keys
)(nint)m.WParamInternal | ModifierKeys);
21898
if (ke.KeyCode !=
Keys
.ProcessKey || m.LParamInternal != 0x01) // Changing IME context does not trigger editing mode
21913
if (BeginEditInternal(selectAll: !(ke.KeyCode ==
Keys
.F2 && ModifierKeys == 0 && EditMode == DataGridViewEditMode.EditOnKeystrokeOrF2)))
21945
KeyEventArgs ke = new((
Keys
)(nint)m.WParamInternal | ModifierKeys);
21955
Keys
.Escape or
Keys
.Space => true,
21960
Keys
.Delete
21961
or
Keys
.Down
21962
or
Keys
.End
21963
or
Keys
.Enter
21964
or
Keys
.Escape
21965
or
Keys
.F2
21966
or
Keys
.F3
21967
or
Keys
.Home
21968
or
Keys
.Left
21969
or
Keys
.Next
21970
or
Keys
.Prior
21971
or
Keys
.Right
21972
or
Keys
.Space
21973
or
Keys
.Tab
21974
or
Keys
.Up => true,
22012
private bool? ProcessColumnResize(
Keys
keyData, int step)
22014
if ((keyData &
Keys
.Alt) ==
Keys
.Alt && AllowUserToResizeColumns && _ptCurrentCell.X != -1)
22048
protected bool ProcessControlShiftF10Keys(
Keys
keyData)
22070
protected bool ProcessLeftKey(
Keys
keyData) => RightToLeftInternal
22074
private bool ProcessLeftKeyPrivate(
Keys
keyData)
22110
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22112
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22116
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22221
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22223
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22227
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22330
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22332
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22336
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22474
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22476
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22926
protected bool ProcessNextKey(
Keys
keyData)
23040
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23080
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23116
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23189
protected bool ProcessPriorKey(
Keys
keyData)
23299
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23338
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23374
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23447
protected bool ProcessRightKey(
Keys
keyData) => RightToLeftInternal
23451
private bool ProcessRightKeyPrivate(
Keys
keyData)
23489
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23491
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23495
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23599
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23601
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23605
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23708
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23710
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23714
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23854
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23856
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
24266
protected bool ProcessSpaceKey(
Keys
keyData)
24268
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift && _ptCurrentCell.X != -1)
24351
protected bool ProcessTabKey(
Keys
keyData)
24355
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24357
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24391
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24397
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24434
case
Keys
.Tab:
24439
case
Keys
.Up:
24444
case
Keys
.Down:
24449
case
Keys
.Next:
24454
case
Keys
.Prior:
24459
case
Keys
.Left:
24464
case
Keys
.Right:
24469
case
Keys
.F2:
24474
case
Keys
.F3:
24479
case
Keys
.F10:
24489
case
Keys
.Home:
24494
case
Keys
.D0:
24495
case
Keys
.NumPad0:
24500
case
Keys
.Delete:
24505
case
Keys
.End:
24510
case
Keys
.Enter:
24515
case
Keys
.Escape:
24520
case
Keys
.A:
24525
case
Keys
.C:
24526
case
Keys
.Insert:
24531
case
Keys
.Space:
24540
protected bool ProcessUpKey(
Keys
keyData)
24563
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24565
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24657
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24761
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24763
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24848
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24945
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24947
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
25066
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
25198
if ((keyData &
Keys
.Control) ==
Keys
.Control)
25278
protected bool ProcessZeroKey(
Keys
keyData)
25298
if ((keyData & (
Keys
.Alt |
Keys
.Shift |
Keys
.Control)) ==
Keys
.Control && IsCurrentCellInEditMode)
30031
Keys
modifierKeys = ModifierKeys;
30032
if (GetTabKeyEffective((modifierKeys &
Keys
.Shift) ==
Keys
.Shift, (modifierKeys &
Keys
.Control) ==
Keys
.Control))
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (4)
440
e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift;
443
e.KeyCode ==
Keys
.Space;
464
if (e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift)
478
if (e.KeyCode ==
Keys
.Space)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (3)
1382
sb.Append((char)
Keys
.Return);
1383
sb.Append((char)
Keys
.LineFeed);
1388
sb.Append(csv ? ',' : (char)
Keys
.Tab);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (4)
758
e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift;
760
protected override bool KeyUpUnsharesRow(KeyEventArgs e, int rowIndex) => e.KeyCode ==
Keys
.Space;
812
if (e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift)
826
if (e.KeyCode ==
Keys
.Space)
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (3)
193
stringBuilder.Append((char)
Keys
.Return);
194
stringBuilder.Append((char)
Keys
.LineFeed);
199
stringBuilder.Append(csv ? ',' : (char)
Keys
.Tab);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (12)
1512
if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >=
Keys
.F1 && e.KeyCode <=
Keys
.F24)) ||
1513
(e.KeyCode >=
Keys
.NumPad0 && e.KeyCode <=
Keys
.Divide) ||
1514
(e.KeyCode >=
Keys
.OemSemicolon && e.KeyCode <=
Keys
.Oem102) ||
1515
(e.KeyCode ==
Keys
.Space && !e.Shift) ||
1516
(e.KeyCode ==
Keys
.F4) ||
1517
((e.KeyCode ==
Keys
.Down || e.KeyCode ==
Keys
.Up) && e.Alt)) &&
1518
(!e.Alt || (e.KeyCode ==
Keys
.Down || e.KeyCode ==
Keys
.Up)) &&
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (7)
89
public virtual bool EditingControlWantsInputKey(
Keys
keyData, bool dataGridViewWantsInputKey)
91
var
maskedKeyData = keyData &
Keys
.KeyCode;
92
if (maskedKeyData ==
Keys
.Down ||
93
maskedKeyData ==
Keys
.Up ||
94
(DroppedDown && (maskedKeyData ==
Keys
.Escape)) ||
95
maskedKeyData ==
Keys
.Enter)
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (2)
685
if (e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift)
731
if (e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
165
stringBuilder.Append((char)
Keys
.Return);
166
stringBuilder.Append((char)
Keys
.LineFeed);
171
stringBuilder.Append(csv ? ',' : (char)
Keys
.Tab);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (7)
534
if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >=
Keys
.F1 && e.KeyCode <=
Keys
.F24)) ||
535
(e.KeyCode >=
Keys
.NumPad0 && e.KeyCode <=
Keys
.Divide) ||
536
(e.KeyCode >=
Keys
.OemSemicolon && e.KeyCode <=
Keys
.Oem102) ||
537
(e.KeyCode ==
Keys
.Space && !e.Shift)) &&
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (23)
125
public virtual bool EditingControlWantsInputKey(
Keys
keyData, bool dataGridViewWantsInputKey)
127
switch (keyData &
Keys
.KeyCode)
129
case
Keys
.Right:
140
case
Keys
.Left:
152
case
Keys
.Down:
163
case
Keys
.Up:
174
case
Keys
.Home:
175
case
Keys
.End:
183
case
Keys
.Prior:
184
case
Keys
.Next:
192
case
Keys
.Delete:
201
case
Keys
.Enter:
202
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift && Multiline && AcceptsReturn)
254
switch ((
Keys
)(nint)m.WParamInternal)
256
case
Keys
.Enter:
258
&& !(ModifierKeys ==
Keys
.Shift && Multiline && AcceptsReturn))
268
case
Keys
.LineFeed:
269
if (m.MsgInternal == PInvokeCore.WM_CHAR && ModifierKeys ==
Keys
.Control && Multiline && AcceptsReturn)
277
case
Keys
.A:
278
if (m.MsgInternal == PInvokeCore.WM_KEYDOWN && ModifierKeys ==
Keys
.Control)
System\Windows\Forms\Controls\DataGridView\IDataGridViewEditingControl.cs (1)
45
bool EditingControlWantsInputKey(
Keys
keyData, bool dataGridViewWantsInputKey);
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (8)
1030
protected override bool IsInputKey(
Keys
keyData)
1032
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
1037
return (keyData &
Keys
.KeyCode) switch
1039
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.DateTimePickerAccessibleObject.cs (1)
136
PInvokeCore.SendMessage(owner, PInvokeCore.WM_SYSKEYDOWN, (WPARAM)(int)
Keys
.Down);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (14)
797
if (e.KeyCode ==
Keys
.Enter)
1406
protected override bool ProcessDialogKey(
Keys
keyData)
1408
if ((keyData & (
Keys
.Alt |
Keys
.Control)) !=
Keys
.Alt)
1410
Keys
keyCode = keyData &
Keys
.KeyCode;
1413
case
Keys
.Tab:
1416
bool forward = (keyData &
Keys
.Shift) !=
Keys
.Shift;
1424
case
Keys
.Up:
1425
case
Keys
.Left:
1432
case
Keys
.Down:
1433
case
Keys
.Right:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (10)
916
Keys
keycode = (
Keys
)m.WParamInternal.LOWORD;
919
Keys
.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)
575
protected override bool IsInputKey(
Keys
keyData)
577
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
582
return (keyData &
Keys
.KeyCode) switch
584
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
System\Windows\Forms\Controls\ListView\ListView.cs (16)
4255
protected override bool IsInputKey(
Keys
keyData)
4257
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
4262
switch (keyData &
Keys
.KeyCode)
4264
case
Keys
.PageUp:
4265
case
Keys
.PageDown:
4266
case
Keys
.Home:
4267
case
Keys
.End:
4279
switch (keyData &
Keys
.KeyCode)
4281
case
Keys
.Return:
4282
case
Keys
.Escape:
6691
if ((lvkd->wVKey == (short)
Keys
.Down || lvkd->wVKey == (short)
Keys
.Up) && SelectedItems.Count > 0)
6694
if (lvkd->wVKey == (short)
Keys
.Down
6705
if (lvkd->wVKey == (short)
Keys
.Up
6717
if (lvkd->wVKey == (short)
Keys
.Space)
System\Windows\Forms\Controls\Menus\MenuStrip.cs (3)
225
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
230
if (keyData ==
Keys
.Space)
241
PInvokeCore.PostMessage(ancestor, PInvokeCore.WM_SYSCOMMAND, (WPARAM)PInvoke.SC_KEYMENU, (LPARAM)(int)
Keys
.Space);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (8)
1336
protected override bool IsInputKey(
Keys
keyData)
1338
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
1343
return (keyData &
Keys
.KeyCode) switch
1345
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (6)
3221
protected override bool ProcessDialogKey(
Keys
keyData)
3223
if ((keyData &
Keys
.KeyCode) !=
Keys
.Tab
3224
|| keyData.HasFlag(
Keys
.Control)
3225
|| keyData.HasFlag(
Keys
.Alt))
3231
if (keyData.HasFlag(
Keys
.Shift))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (77)
1497
if (_dropDownHolder?.Visible == true && m.MsgInternal == PInvokeCore.WM_KEYDOWN && (
Keys
)(nint)m.WParamInternal !=
Keys
.Tab)
1546
Keys
modifiers = ModifierKeys;
1547
if ((modifiers & ~
Keys
.Shift) != 0)
1563
case unchecked((char)(int)(long)
Keys
.Tab):
2022
protected override bool IsInputKey(
Keys
keyData)
2024
switch (keyData &
Keys
.KeyCode)
2026
case
Keys
.Escape:
2027
case
Keys
.Tab:
2028
case
Keys
.F4:
2031
case
Keys
.Return:
2322
if (e.KeyCode ==
Keys
.Return)
2430
private bool ProcessEnumUpAndDown(GridEntry entry,
Keys
keyCode, bool closeDropDown = true)
2458
if (keyCode ==
Keys
.Up)
2488
if (!e.Alt && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down))
2503
else if ((e.KeyCode ==
Keys
.Left || e.KeyCode ==
Keys
.Right)
2504
&& (e.Modifiers & ~
Keys
.Shift) != 0)
2612
if ((ModifierKeys & (
Keys
.Alt |
Keys
.Control)) != 0)
2694
Keys
keyCode = e.KeyCode;
2699
if (keyCode ==
Keys
.Tab)
2709
if (keyCode ==
Keys
.Down && altPressed && DropDownButton.Visible)
2715
if (keyCode ==
Keys
.Up && altPressed && DropDownButton.Visible && (_dropDownHolder is not null) && _dropDownHolder.Visible)
2730
case
Keys
.Up:
2731
case
Keys
.Down:
2732
int position = keyCode ==
Keys
.Up ? _selectedRow - 1 : _selectedRow + 1;
2736
case
Keys
.Left:
2755
case
Keys
.Right:
2781
case
Keys
.Return:
2792
case
Keys
.Home:
2793
case
Keys
.End:
2795
SelectGridEntry(allEntries[keyCode ==
Keys
.Home ? 0 : allEntries.Count - 1], pageIn: true);
2797
case
Keys
.Add:
2798
case
Keys
.Oemplus:
2799
case
Keys
.OemMinus:
2800
case
Keys
.Subtract:
2808
bool expand = keyCode is
Keys
.Add or
Keys
.Oemplus;
2814
case
Keys
.D8:
2817
goto case
Keys
.Multiply;
2821
case
Keys
.Multiply:
2827
case
Keys
.Prior: // PAGE_UP
2828
case
Keys
.Next: // PAGE_DOWN
2830
bool next = keyCode ==
Keys
.Next;
2859
case
Keys
.Insert:
2863
goto case
Keys
.V;
2866
goto case
Keys
.C;
2867
case
Keys
.C:
2876
case
Keys
.Delete:
2881
goto case
Keys
.X;
2885
case
Keys
.X:
2895
case
Keys
.V:
2903
case
Keys
.A:
2914
if (e.KeyData == (
Keys
.C |
Keys
.Alt |
Keys
.Shift |
Keys
.Control))
2924
&& (keyCode ==
Keys
.Up || keyCode ==
Keys
.Down))
3118
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
3802
protected override bool ProcessDialogKey(
Keys
keyData)
3806
Keys
keyCode = keyData &
Keys
.KeyCode;
3809
case
Keys
.F4:
3823
case
Keys
.Tab:
3825
if (((keyData &
Keys
.Control) != 0) ||
3826
((keyData &
Keys
.Alt) != 0))
3831
bool forward = (keyData &
Keys
.Shift) == 0;
3893
case
Keys
.Up:
3894
case
Keys
.Down:
3895
case
Keys
.Left:
3896
case
Keys
.Right:
3898
case
Keys
.Return:
5333
if (_selectedGridEntry is not null && (ModifierKeys &
Keys
.Shift) == 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (8)
523
protected override bool ProcessDialogKey(
Keys
keyData)
525
if ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) == 0)
527
switch (keyData &
Keys
.KeyCode)
529
case
Keys
.Escape:
532
case
Keys
.F4:
535
case
Keys
.Return:
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.GridViewTextBox.cs (47)
100
protected override bool IsInputKey(
Keys
keyData)
103
switch (keyData &
Keys
.KeyCode)
105
case
Keys
.Escape:
106
case
Keys
.Tab:
107
case
Keys
.F4:
108
case
Keys
.F1:
109
case
Keys
.Return:
121
protected override bool IsInputChar(char keyChar) => (
Keys
)keyChar switch
124
Keys
.Tab or
Keys
.Return => false,
181
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
184
switch (keyData &
Keys
.KeyCode)
186
case
Keys
.Z:
187
case
Keys
.C:
188
case
Keys
.X:
189
case
Keys
.V:
190
if (((keyData &
Keys
.Control) != 0) && ((keyData &
Keys
.Shift) == 0) && ((keyData &
Keys
.Alt) == 0))
197
case
Keys
.A:
198
if (((keyData &
Keys
.Control) != 0) && ((keyData &
Keys
.Shift) == 0) && ((keyData &
Keys
.Alt) == 0))
206
case
Keys
.Insert:
207
if (((keyData &
Keys
.Alt) == 0))
209
if (((keyData &
Keys
.Control) != 0) ^ ((keyData &
Keys
.Shift) == 0))
217
case
Keys
.Delete:
218
if (((keyData &
Keys
.Control) == 0) && ((keyData &
Keys
.Shift) != 0) && ((keyData &
Keys
.Alt) == 0))
222
else if (((keyData &
Keys
.Control) == 0) && ((keyData &
Keys
.Shift) == 0) && ((keyData &
Keys
.Alt) == 0))
244
protected override bool ProcessDialogKey(
Keys
keyData)
247
if ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) == 0)
249
switch (keyData &
Keys
.KeyCode)
251
case
Keys
.Return:
259
case
Keys
.Escape:
262
case
Keys
.F4:
269
if ((keyData &
Keys
.KeyCode) ==
Keys
.Tab && ((keyData & (
Keys
.Control |
Keys
.Alt)) == 0))
357
if (PropertyGridView.EditTextBoxNeedsCommit || PropertyGridView.WantsTab(forward: (ModifierKeys &
Keys
.Shift) == 0))
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
2592
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (5)
88
Keys
modifierKeys = ModifierKeys;
112
if ((modifierKeys &
Keys
.Control) ==
Keys
.Control)
117
if ((modifierKeys &
Keys
.Shift) ==
Keys
.Shift)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
804
if (_splitTarget is not null && e.KeyCode ==
Keys
.Escape)
System\Windows\Forms\Controls\Splitter\Splitter.SplitterMessageFilter.cs (2)
26
if (m.MsgInternal == PInvokeCore.WM_KEYDOWN && (
Keys
)(nint)m.WParamInternal ==
Keys
.Escape)
System\Windows\Forms\Controls\TabControl\TabControl.cs (15)
1177
protected override bool IsInputKey(
Keys
keyData)
1179
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
1184
return (keyData &
Keys
.KeyCode) switch
1186
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
1376
if (ke.KeyCode ==
Keys
.Tab && (ke.KeyData &
Keys
.Control) != 0)
1378
bool forward = (ke.KeyData &
Keys
.Shift) == 0;
1382
if (ke.KeyCode ==
Keys
.PageDown && (ke.KeyData &
Keys
.Control) != 0)
1387
if (ke.KeyCode ==
Keys
.PageUp && (ke.KeyData &
Keys
.Control) != 0)
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (28)
536
protected override bool IsInputKey(
Keys
keyData)
538
if ((keyData &
Keys
.KeyCode) ==
Keys
.Return)
1167
Delete(
Keys
.Delete, 0, _maskedTextProvider.Length);
1503
private void Delete(
Keys
keyCode, int startPosition, int selectionLen)
1506
Debug.Assert(keyCode is
Keys
.Delete or
Keys
.Back, $"Delete called with keyCode == {keyCode}");
1516
if (keyCode ==
Keys
.Back)
1562
if (keyCode ==
Keys
.Delete)
1594
if (keyCode ==
Keys
.Back) // Case 3.
1854
Keys
keyCode = e.KeyCode;
1857
if (keyCode is
Keys
.Return or
Keys
.Escape)
1864
if (keyCode ==
Keys
.Insert && e.Modifiers ==
Keys
.None && _insertMode == InsertKeyMode.Default)
1886
case
Keys
.H: // ctrl-h == Backspace == '\b'
1887
keyCode =
Keys
.Back; // handle it below.
1899
if (keyCode is
Keys
.Delete or
Keys
.Back) // Deletion keys.
1907
case
Keys
.Shift:
1908
if (keyCode ==
Keys
.Delete)
1910
keyCode =
Keys
.Back;
1915
case
Keys
.Control:
1918
if (keyCode ==
Keys
.Delete) // delete to the end of the string.
2289
Delete(
Keys
.Delete, selStart, selLength);
2422
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
2710
Delete(
Keys
.Delete, selStart, selLength);
2832
Delete(
Keys
.Delete, startEditPos, selectionLen);
System\Windows\Forms\Controls\TextBox\TextBox.cs (7)
533
protected override bool IsInputKey(
Keys
keyData)
535
if (Multiline && (keyData &
Keys
.Alt) == 0)
537
switch (keyData &
Keys
.KeyCode)
539
case
Keys
.Return:
689
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
692
if (!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,
176
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
187
(int)keyData == (shortcutValue | (int)
Keys
.Shift))
209
if (!ReadOnly && (keyData == (
Keys
.Control |
Keys
.Back) || keyData == (
Keys
.Control |
Keys
.Shift |
Keys
.Back)))
1267
protected bool ContainsNavigationKeyCode(
Keys
keyCode) => keyCode switch
1269
Keys
.Up or
Keys
.Down or
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End or
Keys
.Left or
Keys
.Right => true,
1316
protected override bool IsInputKey(
Keys
keyData)
1318
if ((keyData &
Keys
.Alt) !=
Keys
.Alt)
1320
switch (keyData &
Keys
.KeyCode)
1322
case
Keys
.Tab:
1325
return Multiline && _textBoxFlags[s_acceptsTab] && ((keyData &
Keys
.Control) == 0);
1326
case
Keys
.Escape:
1333
case
Keys
.Back:
1340
case
Keys
.PageUp:
1341
case
Keys
.PageDown:
1342
case
Keys
.Home:
1343
case
Keys
.End:
1396
protected override bool ProcessDialogKey(
Keys
keyData)
1398
Keys
keyCode = keyData &
Keys
.KeyCode;
1400
if (keyCode ==
Keys
.Tab && AcceptsTab && (keyData &
Keys
.Control) != 0)
1403
keyData &= ~
Keys
.Control;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (39)
52
private Dictionary<
Keys
, ToolStripMenuItem>? _shortcuts;
1647
internal Dictionary<
Keys
, ToolStripMenuItem> Shortcuts
1651
_shortcuts ??= new Dictionary<
Keys
, ToolStripMenuItem>(1);
2054
bool forward = LastKeyData ==
Keys
.Tab || (TabStop && start is null && LastKeyData !=
Keys
.Left);
2552
protected override bool IsInputKey(
Keys
keyData) =>
2643
internal bool ProcessCmdKeyInternal(ref Message m,
Keys
keyData)
2676
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
2715
(keyData &
Keys
.Control) ==
Keys
.Control && (keyData &
Keys
.KeyCode) ==
Keys
.Tab;
2720
&& ToolStripManager.SelectNextToolStrip(this, forward: (keyData &
Keys
.Shift) ==
Keys
.None))
2739
protected override bool ProcessDialogKey(
Keys
keyData)
2757
bool hasModifiers = ((keyData & (
Keys
.Alt |
Keys
.Control)) !=
Keys
.None);
2759
Keys
keyCode = keyData &
Keys
.KeyCode;
2762
case
Keys
.Back:
2772
case
Keys
.Tab:
2776
retVal = ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None);
2780
case
Keys
.Left:
2781
case
Keys
.Right:
2782
case
Keys
.Up:
2783
case
Keys
.Down:
2786
case
Keys
.Home:
2790
case
Keys
.End:
2794
case
Keys
.Escape: // escape and menu key should restore focus
2849
if (!inMenuMode && ModifierKeys ==
Keys
.Alt)
3038
internal virtual bool ProcessArrowKey(
Keys
keyCode)
3045
case
Keys
.Left:
3046
case
Keys
.Right:
3047
retVal = ProcessLeftRightArrowKey(keyCode ==
Keys
.Right);
3049
case
Keys
.Up:
3050
case
Keys
.Down:
3054
if (keyCode ==
Keys
.Down)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (2)
235
protected internal override bool ProcessDialogKey(
Keys
keyData)
241
if (keyData ==
Keys
.Space && SupportsSpaceKey && CheckOnClick && Enabled && !IsOnDropDown)
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.cs (6)
50
protected override bool IsInputKey(
Keys
keyData)
52
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
54
switch (keyData &
Keys
.KeyCode)
56
case
Keys
.Down:
57
case
Keys
.Up:
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (2)
814
protected internal override bool ProcessCmdKey(ref Message m,
Keys
keyData) => false;
819
protected internal override bool ProcessDialogKey(
Keys
keyData) => false;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (7)
1287
internal override bool ProcessArrowKey(
Keys
keyCode)
1291
if (keyCode is
Keys
.Left or
Keys
.Right)
1293
bool forward = keyCode ==
Keys
.Right;
1351
protected override bool ProcessDialogKey(
Keys
keyData)
1374
if ((keyData &
Keys
.KeyCode) ==
Keys
.Escape)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
131
if ((Control.ModifierKeys !=
Keys
.Alt) &&
152
if ((Control.ModifierKeys !=
Keys
.Alt) &&
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (16)
554
protected internal override bool ProcessCmdKey(ref Message m,
Keys
keyData)
564
protected internal override bool ProcessDialogKey(
Keys
keyData)
566
Keys
keyCode = keyData &
Keys
.KeyCode;
573
if (isTopLevel && (keyCode ==
Keys
.Down || keyCode ==
Keys
.Up || keyCode ==
Keys
.Enter || (SupportsSpaceKey && keyCode ==
Keys
.Space)))
589
bool forward = ((keyCode ==
Keys
.Enter) || (SupportsSpaceKey && keyCode ==
Keys
.Space));
590
forward = (forward || (menusCascadeRight && keyCode ==
Keys
.Left) || (!menusCascadeRight && keyCode ==
Keys
.Right));
608
if (isTopLevel && (keyCode ==
Keys
.Down || keyCode ==
Keys
.Up))
617
bool backward = ((menusCascadeRight && keyCode ==
Keys
.Right) || (!menusCascadeRight && keyCode ==
Keys
.Left));
System\Windows\Forms\Controls\ToolStrips\ToolStripGrip.cs (1)
106
return (Control.MouseButtons == MouseButtons.Left) && (Control.ModifierKeys ==
Keys
.None);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (7)
2055
if (Control.ModifierKeys ==
Keys
.Alt)
2401
protected internal virtual bool IsInputKey(
Keys
keyData) => false;
2467
if (PInvoke.GetKeyState((int)
Keys
.LButton) < 0)
3041
protected internal virtual bool ProcessDialogKey(
Keys
keyData)
3043
if (keyData ==
Keys
.Enter || (_state[s_stateSupportsSpaceKey] && keyData ==
Keys
.Space))
3060
protected internal virtual bool ProcessCmdKey(ref Message m,
Keys
keyData) => false;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (27)
669
public static bool IsValidShortcut(
Keys
shortcut)
672
Keys
keyCode = shortcut &
Keys
.KeyCode;
673
Keys
modifiers = shortcut &
Keys
.Modifiers;
675
if (shortcut ==
Keys
.None)
679
else if (keyCode is
Keys
.Delete or
Keys
.Insert)
683
else if ((int)keyCode is >= ((int)
Keys
.F1) and <= ((int)
Keys
.F24))
688
else if ((keyCode !=
Keys
.None) && (modifiers !=
Keys
.None))
692
case
Keys
.Menu:
693
case
Keys
.ControlKey:
694
case
Keys
.ShiftKey:
698
if (modifiers ==
Keys
.Shift)
712
internal static bool IsMenuKey(
Keys
keyData)
713
=> (keyData &
Keys
.KeyCode) is
Keys
.Menu or
Keys
.F10;
715
public static bool IsShortcutDefined(
Keys
shortcut)
732
internal static bool ProcessCmdKey(ref Message m,
Keys
keyData)
757
internal static bool ProcessShortcut(ref Message m,
Keys
shortcut)
894
Keys
keyData = (
Keys
)(nint)m.LParamInternal;
937
if (PInvoke.GetKeyState((int)
Keys
.ShiftKey) < 0 && (keyData ==
Keys
.None))
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (2)
268
Keys
keyData = (
Keys
)(nint)m.WParamInternal;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (19)
101
public ToolStripMenuItem(string? text, Image? image, EventHandler? onClick,
Keys
shortcutKeys)
202
TypeDescriptor.RegisterType<
Keys
>();
355
[DefaultValue(
Keys
.None)]
357
public
Keys
ShortcutKeys
359
get => Properties.GetValueOrDefault(s_propShortcutKeys,
Keys
.None);
362
if ((value !=
Keys
.None) && !ToolStripManager.IsValidShortcut(value))
365
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
Keys
));
368
Keys
originalShortcut = ShortcutKeys;
379
if (originalShortcut !=
Keys
.None)
395
Properties.AddOrRemoveValue(s_propShortcutKeys, value, defaultValue:
Keys
.None);
569
Keys
shortcut = ShortcutKeys;
570
if (shortcut !=
Keys
.None && _lastOwner.Shortcuts.ContainsKey(shortcut))
920
Keys
shortcut = ShortcutKeys;
921
if (shortcut !=
Keys
.None)
1035
protected internal override bool ProcessCmdKey(ref Message m,
Keys
keyData)
1092
internal static string? ShortcutToText(
Keys
shortcutKeys, string? shortcutKeyDisplayString)
1099
if (shortcutKeys ==
Keys
.None)
1106
return TypeDescriptor.GetConverter(typeof(
Keys
)).ConvertToString(context: null, CultureInfo.CurrentUICulture, shortcutKeys);
1111
return TypeDescriptor.GetConverterFromRegisteredType(typeof(
Keys
)).ConvertToString(context: null, CultureInfo.CurrentUICulture, shortcutKeys);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (3)
366
protected internal override bool ProcessDialogKey(
Keys
keyData)
368
if (Enabled && (keyData ==
Keys
.Enter || (SupportsSpaceKey && keyData ==
Keys
.Space)))
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (10)
840
protected override bool IsInputKey(
Keys
keyData)
842
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
847
return (keyData &
Keys
.KeyCode) switch
849
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
925
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
System\Windows\Forms\Controls\TreeView\TreeView.cs (13)
1804
protected override bool IsInputKey(
Keys
keyData)
1809
if (_editNode is not null && (keyData &
Keys
.Alt) == 0)
1811
switch (keyData &
Keys
.KeyCode)
1813
case
Keys
.Return:
1814
case
Keys
.Escape:
1815
case
Keys
.PageUp:
1816
case
Keys
.PageDown:
1817
case
Keys
.Home:
1818
case
Keys
.End:
2257
if (CheckBoxes && (e.KeyData &
Keys
.KeyCode) ==
Keys
.Space)
2287
if ((e.KeyData &
Keys
.KeyCode) ==
Keys
.Space)
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (6)
425
if (InterceptArrowKeys && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down) && !Spinning)
438
if (InterceptArrowKeys && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down))
477
else if ((ModifierKeys & (
Keys
.Control |
Keys
.Alt)) != 0)
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (5)
598
if (e.KeyData ==
Keys
.Up)
605
else if (e.KeyData ==
Keys
.Down)
613
if (e.KeyCode ==
Keys
.Return && UserEdit)
733
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
214
protected override bool ProcessDialogKey(
Keys
keyData) =>
System\Windows\Forms\DataBinding\BindingNavigator.cs (2)
747
case
Keys
.Enter:
750
case
Keys
.Escape:
System\Windows\Forms\Form.cs (9)
4661
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
4691
protected override bool ProcessDialogKey(
Keys
keyData)
4693
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
4695
Keys
keyCode = keyData &
Keys
.KeyCode;
4699
case
Keys
.Return:
4712
case
Keys
.Escape:
System\Windows\Forms\Input\KeyEventArgs.cs (15)
17
public KeyEventArgs(
Keys
keyData)
25
public virtual bool Alt => (KeyData &
Keys
.Alt) ==
Keys
.Alt;
30
public bool Control => (KeyData &
Keys
.Control) ==
Keys
.Control;
41
public
Keys
KeyCode
45
Keys
keyGenerated = KeyData &
Keys
.KeyCode;
50
return
Keys
.None;
61
public int KeyValue => (int)(KeyData &
Keys
.KeyCode);
67
public
Keys
KeyData { get; }
74
public
Keys
Modifiers => KeyData &
Keys
.Modifiers;
79
public virtual bool Shift => (KeyData &
Keys
.Shift) ==
Keys
.Shift;
System\Windows\Forms\Input\KeysConverter.cs (72)
12
/// Provides a type converter to convert <see cref="
Keys
"/> objects to and from various
18
private Dictionary<CultureInfo, Dictionary<string,
Keys
>>? _cultureToKeyName;
38
Dictionary<string,
Keys
> localizedNames = new(34);
40
AddLocalizedKey(nameof(SR.toStringEnter),
Keys
.Return);
41
AddKey("F12",
Keys
.F12);
42
AddKey("F11",
Keys
.F11);
43
AddKey("F10",
Keys
.F10);
44
AddLocalizedKey(nameof(SR.toStringEnd),
Keys
.End);
45
AddLocalizedKey(nameof(SR.toStringControl),
Keys
.Control);
46
AddKey("F8",
Keys
.F8);
47
AddKey("F9",
Keys
.F9);
48
AddLocalizedKey(nameof(SR.toStringAlt),
Keys
.Alt);
49
AddKey("F4",
Keys
.F4);
50
AddKey("F5",
Keys
.F5);
51
AddKey("F6",
Keys
.F6);
52
AddKey("F7",
Keys
.F7);
53
AddKey("F1",
Keys
.F1);
54
AddKey("F2",
Keys
.F2);
55
AddKey("F3",
Keys
.F3);
56
AddLocalizedKey(nameof(SR.toStringPageDown),
Keys
.Next);
57
AddLocalizedKey(nameof(SR.toStringInsert),
Keys
.Insert);
58
AddLocalizedKey(nameof(SR.toStringHome),
Keys
.Home);
59
AddLocalizedKey(nameof(SR.toStringDelete),
Keys
.Delete);
60
AddLocalizedKey(nameof(SR.toStringShift),
Keys
.Shift);
61
AddLocalizedKey(nameof(SR.toStringPageUp),
Keys
.Prior);
62
AddLocalizedKey(nameof(SR.toStringBack),
Keys
.Back);
63
AddLocalizedKey(nameof(SR.toStringNone),
Keys
.None);
68
AddKey("0",
Keys
.D0);
69
AddKey("1",
Keys
.D1);
70
AddKey("2",
Keys
.D2);
71
AddKey("3",
Keys
.D3);
72
AddKey("4",
Keys
.D4);
73
AddKey("5",
Keys
.D5);
74
AddKey("6",
Keys
.D6);
75
AddKey("7",
Keys
.D7);
76
AddKey("8",
Keys
.D8);
77
AddKey("9",
Keys
.D9);
82
void AddKey(string key,
Keys
value)
88
void AddLocalizedKey(string keyName,
Keys
value)
100
private Dictionary<CultureInfo, Dictionary<string,
Keys
>> CultureToKeyName
160
Dictionary<string,
Keys
> keyNames = GetKeyNames(culture);
166
Keys
key = 0;
171
if (!keyNames.TryGetValue(token, out
Keys
currentKey))
175
currentKey = (
Keys
)Enum.Parse(typeof(
Keys
), token);
178
if ((currentKey &
Keys
.KeyCode) != 0)
207
return Enum.ToObject(typeof(
Keys
), finalValue);
224
if (value is not
Keys
and not int)
230
? GetTermsString((
Keys
)value)
232
? GetTermKeys((
Keys
)value)
235
Enum[] GetTermKeys(
Keys
key)
238
Keys
modifiers = key &
Keys
.Modifiers;
239
Dictionary<string,
Keys
> keyNames = GetKeyNames(culture);
242
if (key !=
Keys
.None)
248
Keys
keyValue = keyNames[keyString];
249
if (keyValue !=
Keys
.None && modifiers.HasFlag(keyValue))
258
Keys
keyOnly = key &
Keys
.KeyCode;
263
Keys
keyValue = keyNames[keyString];
283
string GetTermsString(
Keys
key)
286
Keys
modifiers = key &
Keys
.Modifiers;
287
Dictionary<string,
Keys
> keyNames = GetKeyNames(culture);
290
if (key !=
Keys
.None)
296
Keys
keyValue = keyNames[keyString];
297
if (keyValue !=
Keys
.None && modifiers.HasFlag(keyValue))
306
Keys
keyOnly = key &
Keys
.KeyCode;
311
Keys
keyValue = keyNames[keyString];
345
private Dictionary<string,
Keys
> GetKeyNames(CultureInfo? culture)
368
Keys
[] values = [.. CultureToKeyName[CultureInfo.InvariantCulture].Values];
System\Windows\Forms\Input\PreviewKeyDownEventArgs.cs (15)
11
public PreviewKeyDownEventArgs(
Keys
keyData)
20
public
Keys
KeyData { get; }
22
public bool Alt => (KeyData &
Keys
.Alt) ==
Keys
.Alt;
27
public bool Control => (KeyData &
Keys
.Control) ==
Keys
.Control;
33
public
Keys
KeyCode
37
Keys
keyGenerated = KeyData &
Keys
.KeyCode;
40
return
Keys
.None;
51
public int KeyValue => (int)(KeyData &
Keys
.KeyCode);
58
public
Keys
Modifiers => KeyData &
Keys
.Modifiers;
63
public bool Shift => (KeyData &
Keys
.Shift) ==
Keys
.Shift;
System\Windows\Forms\Layout\Containers\ContainerControl.cs (16)
1192
protected override bool ProcessDialogKey(
Keys
keyData)
1195
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
1197
Keys
keyCode = keyData &
Keys
.KeyCode;
1200
case
Keys
.Tab:
1201
if (ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None))
1207
case
Keys
.Left:
1208
case
Keys
.Right:
1209
case
Keys
.Up:
1210
case
Keys
.Down:
1211
if (ProcessArrowKey(keyCode is
Keys
.Right or
Keys
.Down))
1223
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
System\Windows\Forms\Layout\Containers\SplitContainer.cs (28)
935
if (e.KeyData ==
Keys
.Escape && _splitBegin)
944
&& (e.KeyData ==
Keys
.Right || e.KeyData ==
Keys
.Down || e.KeyData ==
Keys
.Left || e.KeyData ==
Keys
.Up))
952
if (_splitterFocused && (e.KeyData ==
Keys
.Left || e.KeyData ==
Keys
.Up))
959
if (_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))
2297
protected override bool ProcessDialogKey(
Keys
keyData)
2299
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
2301
Keys
keyCode = keyData &
Keys
.KeyCode;
2304
case
Keys
.Tab:
2305
if (ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None))
2311
case
Keys
.Left:
2312
case
Keys
.Right:
2313
case
Keys
.Up:
2314
case
Keys
.Down:
2317
if (ProcessArrowKey(keyCode is
Keys
.Right or
2318
Keys
.Down))
System\Windows\Forms\Layout\Containers\SplitContainer.SplitContainerMessageFilter.cs (2)
24
if ((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)
16
protected internal override bool ProcessCmdKey(ref Message m,
Keys
keyData)
System\Windows\Forms\Printing\PrintPreviewControl.cs (19)
904
Keys
keyData = (
Keys
)(nint)msg.WParamInternal | ModifierKeys;
912
switch (keyData &
Keys
.KeyCode)
914
case
Keys
.PageUp:
915
if ((keyData &
Keys
.Modifiers) ==
Keys
.Control)
947
case
Keys
.PageDown:
948
if ((keyData &
Keys
.Modifiers) ==
Keys
.Control)
981
case
Keys
.Home:
982
if ((keyData &
Keys
.Modifiers) ==
Keys
.Control)
988
case
Keys
.End:
989
if (_pageInfo is not null && (keyData &
Keys
.Modifiers) ==
Keys
.Control)
996
case
Keys
.Up:
1014
case
Keys
.Down:
1034
case
Keys
.Left:
1052
case
Keys
.Right:
System\Windows\Forms\Printing\PrintPreviewDialog.cs (17)
1005
protected override bool ProcessDialogKey(
Keys
keyData)
1007
Keys
keyCode = keyData &
Keys
.KeyCode;
1008
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
1012
case
Keys
.Left:
1013
case
Keys
.Right:
1014
case
Keys
.Up:
1015
case
Keys
.Down:
1019
else if ((keyData &
Keys
.Control) ==
Keys
.Control)
1023
Keys
.D1 => PerformPageToolStripButtonClick(_onePageToolStripButton),
1024
Keys
.D2 => PerformPageToolStripButtonClick(_twoPagesToolStripButton),
1025
Keys
.D3 => PerformPageToolStripButtonClick(_threePagesToolStripButton),
1026
Keys
.D4 => PerformPageToolStripButtonClick(_fourPagesToolStripButton),
1027
Keys
.D5 => PerformPageToolStripButtonClick(_sixPagesToolStripButton),
System\Windows\Forms\Printing\PrintPreviewDialog.PrintPreviewDialogToolStripButton.cs (3)
13
protected internal override bool ProcessDialogKey(
Keys
keyData)
15
if (keyData ==
Keys
.Enter || (SupportsSpaceKey && keyData ==
Keys
.Space))
System\Windows\Forms\SendKeys\SendKeys.cs (80)
24
new("ENTER",
Keys
.Return),
25
new("TAB",
Keys
.Tab),
26
new("ESC",
Keys
.Escape),
27
new("ESCAPE",
Keys
.Escape),
28
new("HOME",
Keys
.Home),
29
new("END",
Keys
.End),
30
new("LEFT",
Keys
.Left),
31
new("RIGHT",
Keys
.Right),
32
new("UP",
Keys
.Up),
33
new("DOWN",
Keys
.Down),
34
new("PGUP",
Keys
.Prior),
35
new("PGDN",
Keys
.Next),
36
new("NUMLOCK",
Keys
.NumLock),
37
new("SCROLLLOCK",
Keys
.Scroll),
38
new("PRTSC",
Keys
.PrintScreen),
39
new("BREAK",
Keys
.Cancel),
40
new("BACKSPACE",
Keys
.Back),
41
new("BKSP",
Keys
.Back),
42
new("BS",
Keys
.Back),
43
new("CLEAR",
Keys
.Clear),
44
new("CAPSLOCK",
Keys
.Capital),
45
new("INS",
Keys
.Insert),
46
new("INSERT",
Keys
.Insert),
47
new("DEL",
Keys
.Delete),
48
new("DELETE",
Keys
.Delete),
49
new("HELP",
Keys
.Help),
50
new("F1",
Keys
.F1),
51
new("F2",
Keys
.F2),
52
new("F3",
Keys
.F3),
53
new("F4",
Keys
.F4),
54
new("F5",
Keys
.F5),
55
new("F6",
Keys
.F6),
56
new("F7",
Keys
.F7),
57
new("F8",
Keys
.F8),
58
new("F9",
Keys
.F9),
59
new("F10",
Keys
.F10),
60
new("F11",
Keys
.F11),
61
new("F12",
Keys
.F12),
62
new("F13",
Keys
.F13),
63
new("F14",
Keys
.F14),
64
new("F15",
Keys
.F15),
65
new("F16",
Keys
.F16),
66
new("MULTIPLY",
Keys
.Multiply),
67
new("ADD",
Keys
.Add),
68
new("SUBTRACT",
Keys
.Subtract),
69
new("DIVIDE",
Keys
.Divide),
70
new("+",
Keys
.Add),
71
new("%", (
Keys
.D5 |
Keys
.Shift)),
72
new("^", (
Keys
.D6 |
Keys
.Shift)),
140
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.ShiftKey, startNewChar, hwnd));
147
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.ControlKey, startNewChar, hwnd));
154
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.Menu, startNewChar, hwnd));
199
AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)
Keys
.ShiftKey, false, hwnd));
205
AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)
Keys
.ControlKey, false, hwnd));
211
AddEvent(new SKEvent(PInvokeCore.WM_SYSKEYUP, (int)
Keys
.Menu, false, hwnd));
339
keystate[(int)
Keys
.Capital] = 0;
340
keystate[(int)
Keys
.NumLock] = 0;
341
keystate[(int)
Keys
.Scroll] = 0;
486
if (haveKeys.HaveShift == 0 && (vk & (int)
Keys
.Shift) != 0)
488
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.ShiftKey, s_startNewChar, hwnd));
493
if (haveKeys.HaveCtrl == 0 && (vk & (int)
Keys
.Control) != 0)
495
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.ControlKey, s_startNewChar, hwnd));
500
if (haveKeys.HaveAlt == 0 && (vk & (int)
Keys
.Alt) != 0)
502
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.Menu, s_startNewChar, hwnd));
529
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.ShiftKey, s_startNewChar, hwnd));
540
AddEvent(new SKEvent(PInvokeCore.WM_KEYDOWN, (uint)
Keys
.ControlKey, s_startNewChar, hwnd));
553
(int)
Keys
.Menu,
603
vk = (int)
Keys
.Return;
778
if (skEvent.ParamL == (int)
Keys
.ShiftKey)
782
else if (skEvent.ParamL == (int)
Keys
.ControlKey)
786
else if (skEvent.ParamL == (int)
Keys
.Menu)
794
AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)
Keys
.ShiftKey, false, default));
798
AddEvent(new SKEvent(PInvokeCore.WM_KEYUP, (int)
Keys
.ControlKey, false, default));
802
AddEvent(new SKEvent(PInvokeCore.WM_SYSKEYUP, (int)
Keys
.Menu, false, default));
834
case (int)
Keys
.CapsLock:
837
case (int)
Keys
.NumLock:
840
case (int)
Keys
.Scroll:
843
case (int)
Keys
.KanaMode:
System\Windows\Forms\SendKeys\SendKeys.KeywordVk.cs (1)
16
public KeywordVk(string keyword,
Keys
key)
System\Windows\Forms\SendKeys\SendKeys.SendKeysHookProc.cs (1)
30
if (PInvoke.GetAsyncKeyState((int)
Keys
.Pause) != 0)
System\Windows\Forms\Shortcut.cs (340)
19
CtrlA =
Keys
.Control +
Keys
.A,
24
CtrlB =
Keys
.Control +
Keys
.B,
29
CtrlC =
Keys
.Control +
Keys
.C,
34
CtrlD =
Keys
.Control +
Keys
.D,
39
CtrlE =
Keys
.Control +
Keys
.E,
44
CtrlF =
Keys
.Control +
Keys
.F,
49
CtrlG =
Keys
.Control +
Keys
.G,
54
CtrlH =
Keys
.Control +
Keys
.H,
59
CtrlI =
Keys
.Control +
Keys
.I,
64
CtrlJ =
Keys
.Control +
Keys
.J,
69
CtrlK =
Keys
.Control +
Keys
.K,
74
CtrlL =
Keys
.Control +
Keys
.L,
79
CtrlM =
Keys
.Control +
Keys
.M,
84
CtrlN =
Keys
.Control +
Keys
.N,
89
CtrlO =
Keys
.Control +
Keys
.O,
94
CtrlP =
Keys
.Control +
Keys
.P,
99
CtrlQ =
Keys
.Control +
Keys
.Q,
104
CtrlR =
Keys
.Control +
Keys
.R,
109
CtrlS =
Keys
.Control +
Keys
.S,
114
CtrlT =
Keys
.Control +
Keys
.T,
119
CtrlU =
Keys
.Control +
Keys
.U,
124
CtrlV =
Keys
.Control +
Keys
.V,
129
CtrlW =
Keys
.Control +
Keys
.W,
134
CtrlX =
Keys
.Control +
Keys
.X,
139
CtrlY =
Keys
.Control +
Keys
.Y,
144
CtrlZ =
Keys
.Control +
Keys
.Z,
149
CtrlShiftA =
Keys
.Control +
Keys
.Shift +
Keys
.A,
154
CtrlShiftB =
Keys
.Control +
Keys
.Shift +
Keys
.B,
159
CtrlShiftC =
Keys
.Control +
Keys
.Shift +
Keys
.C,
164
CtrlShiftD =
Keys
.Control +
Keys
.Shift +
Keys
.D,
169
CtrlShiftE =
Keys
.Control +
Keys
.Shift +
Keys
.E,
174
CtrlShiftF =
Keys
.Control +
Keys
.Shift +
Keys
.F,
179
CtrlShiftG =
Keys
.Control +
Keys
.Shift +
Keys
.G,
184
CtrlShiftH =
Keys
.Control +
Keys
.Shift +
Keys
.H,
189
CtrlShiftI =
Keys
.Control +
Keys
.Shift +
Keys
.I,
194
CtrlShiftJ =
Keys
.Control +
Keys
.Shift +
Keys
.J,
199
CtrlShiftK =
Keys
.Control +
Keys
.Shift +
Keys
.K,
204
CtrlShiftL =
Keys
.Control +
Keys
.Shift +
Keys
.L,
209
CtrlShiftM =
Keys
.Control +
Keys
.Shift +
Keys
.M,
214
CtrlShiftN =
Keys
.Control +
Keys
.Shift +
Keys
.N,
219
CtrlShiftO =
Keys
.Control +
Keys
.Shift +
Keys
.O,
224
CtrlShiftP =
Keys
.Control +
Keys
.Shift +
Keys
.P,
229
CtrlShiftQ =
Keys
.Control +
Keys
.Shift +
Keys
.Q,
234
CtrlShiftR =
Keys
.Control +
Keys
.Shift +
Keys
.R,
239
CtrlShiftS =
Keys
.Control +
Keys
.Shift +
Keys
.S,
244
CtrlShiftT =
Keys
.Control +
Keys
.Shift +
Keys
.T,
249
CtrlShiftU =
Keys
.Control +
Keys
.Shift +
Keys
.U,
254
CtrlShiftV =
Keys
.Control +
Keys
.Shift +
Keys
.V,
259
CtrlShiftW =
Keys
.Control +
Keys
.Shift +
Keys
.W,
264
CtrlShiftX =
Keys
.Control +
Keys
.Shift +
Keys
.X,
269
CtrlShiftY =
Keys
.Control +
Keys
.Shift +
Keys
.Y,
274
CtrlShiftZ =
Keys
.Control +
Keys
.Shift +
Keys
.Z,
279
F1 =
Keys
.F1,
284
F2 =
Keys
.F2,
289
F3 =
Keys
.F3,
294
F4 =
Keys
.F4,
299
F5 =
Keys
.F5,
304
F6 =
Keys
.F6,
309
F7 =
Keys
.F7,
310
F8 =
Keys
.F8,
315
F9 =
Keys
.F9,
320
F10 =
Keys
.F10,
325
F11 =
Keys
.F11,
330
F12 =
Keys
.F12,
335
ShiftF1 =
Keys
.Shift +
Keys
.F1,
340
ShiftF2 =
Keys
.Shift +
Keys
.F2,
345
ShiftF3 =
Keys
.Shift +
Keys
.F3,
350
ShiftF4 =
Keys
.Shift +
Keys
.F4,
355
ShiftF5 =
Keys
.Shift +
Keys
.F5,
360
ShiftF6 =
Keys
.Shift +
Keys
.F6,
365
ShiftF7 =
Keys
.Shift +
Keys
.F7,
370
ShiftF8 =
Keys
.Shift +
Keys
.F8,
375
ShiftF9 =
Keys
.Shift +
Keys
.F9,
380
ShiftF10 =
Keys
.Shift +
Keys
.F10,
385
ShiftF11 =
Keys
.Shift +
Keys
.F11,
390
ShiftF12 =
Keys
.Shift +
Keys
.F12,
395
CtrlF1 =
Keys
.Control +
Keys
.F1,
400
CtrlF2 =
Keys
.Control +
Keys
.F2,
405
CtrlF3 =
Keys
.Control +
Keys
.F3,
410
CtrlF4 =
Keys
.Control +
Keys
.F4,
415
CtrlF5 =
Keys
.Control +
Keys
.F5,
420
CtrlF6 =
Keys
.Control +
Keys
.F6,
425
CtrlF7 =
Keys
.Control +
Keys
.F7,
430
CtrlF8 =
Keys
.Control +
Keys
.F8,
435
CtrlF9 =
Keys
.Control +
Keys
.F9,
440
CtrlF10 =
Keys
.Control +
Keys
.F10,
445
CtrlF11 =
Keys
.Control +
Keys
.F11,
450
CtrlF12 =
Keys
.Control +
Keys
.F12,
455
CtrlShiftF1 =
Keys
.Control +
Keys
.Shift +
Keys
.F1,
460
CtrlShiftF2 =
Keys
.Control +
Keys
.Shift +
Keys
.F2,
465
CtrlShiftF3 =
Keys
.Control +
Keys
.Shift +
Keys
.F3,
470
CtrlShiftF4 =
Keys
.Control +
Keys
.Shift +
Keys
.F4,
475
CtrlShiftF5 =
Keys
.Control +
Keys
.Shift +
Keys
.F5,
480
CtrlShiftF6 =
Keys
.Control +
Keys
.Shift +
Keys
.F6,
485
CtrlShiftF7 =
Keys
.Control +
Keys
.Shift +
Keys
.F7,
490
CtrlShiftF8 =
Keys
.Control +
Keys
.Shift +
Keys
.F8,
495
CtrlShiftF9 =
Keys
.Control +
Keys
.Shift +
Keys
.F9,
500
CtrlShiftF10 =
Keys
.Control +
Keys
.Shift +
Keys
.F10,
505
CtrlShiftF11 =
Keys
.Control +
Keys
.Shift +
Keys
.F11,
510
CtrlShiftF12 =
Keys
.Control +
Keys
.Shift +
Keys
.F12,
515
Ins =
Keys
.Insert,
520
CtrlIns =
Keys
.Control +
Keys
.Insert,
525
ShiftIns =
Keys
.Shift +
Keys
.Insert,
530
Del =
Keys
.Delete,
535
CtrlDel =
Keys
.Control +
Keys
.Delete,
540
ShiftDel =
Keys
.Shift +
Keys
.Delete,
545
AltRightArrow =
Keys
.Alt +
Keys
.Right,
550
AltLeftArrow =
Keys
.Alt +
Keys
.Left,
555
AltUpArrow =
Keys
.Alt +
Keys
.Up,
560
AltDownArrow =
Keys
.Alt +
Keys
.Down,
565
AltBksp =
Keys
.Alt +
Keys
.Back,
570
AltF1 =
Keys
.Alt +
Keys
.F1,
575
AltF2 =
Keys
.Alt +
Keys
.F2,
580
AltF3 =
Keys
.Alt +
Keys
.F3,
585
AltF4 =
Keys
.Alt +
Keys
.F4,
590
AltF5 =
Keys
.Alt +
Keys
.F5,
595
AltF6 =
Keys
.Alt +
Keys
.F6,
600
AltF7 =
Keys
.Alt +
Keys
.F7,
605
AltF8 =
Keys
.Alt +
Keys
.F8,
610
AltF9 =
Keys
.Alt +
Keys
.F9,
615
AltF10 =
Keys
.Alt +
Keys
.F10,
620
AltF11 =
Keys
.Alt +
Keys
.F11,
625
AltF12 =
Keys
.Alt +
Keys
.F12,
630
Alt0 =
Keys
.Alt +
Keys
.D0,
635
Alt1 =
Keys
.Alt +
Keys
.D1,
640
Alt2 =
Keys
.Alt +
Keys
.D2,
645
Alt3 =
Keys
.Alt +
Keys
.D3,
650
Alt4 =
Keys
.Alt +
Keys
.D4,
655
Alt5 =
Keys
.Alt +
Keys
.D5,
660
Alt6 =
Keys
.Alt +
Keys
.D6,
665
Alt7 =
Keys
.Alt +
Keys
.D7,
670
Alt8 =
Keys
.Alt +
Keys
.D8,
675
Alt9 =
Keys
.Alt +
Keys
.D9,
680
Ctrl0 =
Keys
.Control +
Keys
.D0,
685
Ctrl1 =
Keys
.Control +
Keys
.D1,
690
Ctrl2 =
Keys
.Control +
Keys
.D2,
695
Ctrl3 =
Keys
.Control +
Keys
.D3,
700
Ctrl4 =
Keys
.Control +
Keys
.D4,
705
Ctrl5 =
Keys
.Control +
Keys
.D5,
710
Ctrl6 =
Keys
.Control +
Keys
.D6,
715
Ctrl7 =
Keys
.Control +
Keys
.D7,
720
Ctrl8 =
Keys
.Control +
Keys
.D8,
725
Ctrl9 =
Keys
.Control +
Keys
.D9,
730
CtrlShift0 =
Keys
.Control +
Keys
.Shift +
Keys
.D0,
735
CtrlShift1 =
Keys
.Control +
Keys
.Shift +
Keys
.D1,
740
CtrlShift2 =
Keys
.Control +
Keys
.Shift +
Keys
.D2,
745
CtrlShift3 =
Keys
.Control +
Keys
.Shift +
Keys
.D3,
750
CtrlShift4 =
Keys
.Control +
Keys
.Shift +
Keys
.D4,
755
CtrlShift5 =
Keys
.Control +
Keys
.Shift +
Keys
.D5,
760
CtrlShift6 =
Keys
.Control +
Keys
.Shift +
Keys
.D6,
765
CtrlShift7 =
Keys
.Control +
Keys
.Shift +
Keys
.D7,
770
CtrlShift8 =
Keys
.Control +
Keys
.Shift +
Keys
.D8,
775
CtrlShift9 =
Keys
.Control +
Keys
.Shift +
Keys
.D9,
System.Windows.Forms.Design (391)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (2)
636
case
Keys
.Delete:
639
case
Keys
.Insert:
System\ComponentModel\Design\CollectionEditor.FilterListBox.cs (2)
77
if ((ModifierKeys & (
Keys
.Control |
Keys
.Alt)) != 0)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (3)
70
protected override bool IsInputKey(
Keys
keyData)
72
if (keyData is
Keys
.Down && _showSplit)
96
if (kevent.KeyCode is
Keys
.Down && _showSplit)
System\ComponentModel\Design\DateTimeEditor.DateTimeUI.cs (3)
48
case
Keys
.Enter:
88
protected override bool IsInputKey(
Keys
keyData) => keyData switch
90
Keys
.Enter => true,
System\ComponentModel\Design\DesignerActionPanel.cs (1)
528
protected override bool ProcessDialogKey(
Keys
keyData)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (11)
200
if (e.KeyData ==
Keys
.Enter)
304
protected internal override bool ProcessDialogKey(
Keys
keyData)
312
if (keyData is (
Keys
.Alt |
Keys
.Down) or (
Keys
.Alt |
Keys
.Up) or
Keys
.F4)
327
else if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
460
protected override bool ProcessDialogKey(
Keys
keyData)
462
if (keyData ==
Keys
.Escape)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.FlyoutDialog.cs (6)
125
protected override bool ProcessDialogKey(
Keys
keyData)
127
if (keyData is (
Keys
.Alt |
Keys
.Down) or (
Keys
.Alt |
Keys
.Up) or
Keys
.F4)
System\ComponentModel\Design\DesignerActionPanel.Line.cs (1)
49
protected internal virtual bool ProcessDialogKey(
Keys
keyData) => false;
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (6)
97
protected override bool ProcessDialogKey(
Keys
keyData)
99
if ((keyData &
Keys
.Control) ==
Keys
.Control)
101
Keys
keyCode = keyData &
Keys
.KeyCode;
104
case
Keys
.Tab:
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (6)
189
if (e.KeyCode ==
Keys
.Down)
219
if (e.KeyCode ==
Keys
.Up)
263
if (e.KeyCode ==
Keys
.Enter)
339
protected override bool IsInputKey(
Keys
keyData)
341
if (keyData is
Keys
.Down or
Keys
.Up)
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (2)
254
protected override bool ProcessDialogKey(
Keys
keyData)
259
if (keyData ==
Keys
.Enter)
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (12)
64
protected override bool IsInputKey(
Keys
keyData)
66
if ((keyData &
Keys
.KeyCode) ==
Keys
.Return && Multiline && (keyData &
Keys
.Alt) == 0)
74
protected override bool ProcessDialogKey(
Keys
keyData)
76
if ((keyData & (
Keys
.Shift |
Keys
.Alt)) == 0)
78
switch (keyData &
Keys
.KeyCode)
80
case
Keys
.Escape:
81
if ((keyData &
Keys
.Control) == 0)
106
if (e is { Control: true, KeyCode:
Keys
.Return, Modifiers:
Keys
.Control })
System\ComponentModel\Design\ObjectSelectorEditor.Selector.cs (3)
94
Keys
key = e.KeyCode;
97
case
Keys
.Return:
105
case
Keys
.Escape:
System\ComponentModel\Design\SelectionService.cs (3)
373
fToggle = (Control.ModifierKeys & (
Keys
.Control |
Keys
.Shift)) > 0;
374
fAdd |= Control.ModifierKeys ==
Keys
.Shift;
System\Drawing\Design\ColorEditor.ColorPalette.cs (15)
228
protected override bool IsInputKey(
Keys
keyData) => keyData switch
230
Keys
.Left or
Keys
.Right or
Keys
.Up or
Keys
.Down or
Keys
.Enter => true,
232
Keys
.F2 => false,
275
case
Keys
.Enter:
280
case
Keys
.Space:
284
case
Keys
.Left:
287
case
Keys
.Right:
290
case
Keys
.Up:
293
case
Keys
.Down:
420
protected override bool ProcessDialogKey(
Keys
keyData)
422
if (keyData ==
Keys
.F2)
System\Drawing\Design\ColorEditor.ColorUI.ColorEditorListBox.cs (2)
14
protected override bool IsInputKey(
Keys
keyData)
18
Keys
.Return => true,
System\Drawing\Design\ColorEditor.ColorUI.cs (7)
284
if (ke.KeyCode ==
Keys
.Return)
331
protected override bool ProcessDialogKey(
Keys
keyData)
336
if ((keyData &
Keys
.Alt) == 0
337
&& (keyData &
Keys
.Control) == 0
338
&& (keyData &
Keys
.KeyCode) ==
Keys
.Tab)
341
bool forward = (keyData &
Keys
.Shift) == 0;
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (2)
429
protected override RadioButton ProcessTabKey(
Keys
keyData)
431
int nextTabIndex = CheckedControl.TabIndex + ((keyData &
Keys
.Shift) == 0 ? 1 : -1);
System\Drawing\Design\CursorEditor.CursorUI.cs (5)
77
protected override bool ProcessDialogKey(
Keys
keyData)
79
if ((keyData &
Keys
.KeyCode) ==
Keys
.Return && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
System\Drawing\Design\SelectionPanelBase.cs (12)
64
Keys
key = e.KeyCode;
69
case
Keys
.Up:
72
case
Keys
.Down:
75
case
Keys
.Left:
78
case
Keys
.Right:
81
case
Keys
.Return:
97
protected override bool ProcessDialogKey(
Keys
keyData)
99
if ((keyData &
Keys
.KeyCode) ==
Keys
.Tab && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
114
protected abstract RadioButton ProcessTabKey(
Keys
keyData);
System\Drawing\SelectionPanelBase.SelectionPanelRadioButton.cs (6)
19
protected override bool IsInputKey(
Keys
keyData) => keyData switch
21
Keys
.Left or
Keys
.Right or
Keys
.Up or
Keys
.Down or
Keys
.Return => true,
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (14)
296
protected override bool ProcessDialogKey(
Keys
keyData)
298
if ((keyData &
Keys
.KeyCode) ==
Keys
.Return && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
304
if ((keyData &
Keys
.KeyCode) ==
Keys
.Escape && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
310
if ((keyData &
Keys
.KeyCode) ==
Keys
.Tab && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
316
i += (keyData &
Keys
.Shift) == 0 ? 1 : -1;
System\Windows\Forms\Design\Behavior\Behavior.cs (1)
330
e.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
619
bool altKeyPressed = Control.ModifierKeys ==
Keys
.Alt;
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (1)
464
bool altKeyPressed = Control.ModifierKeys ==
Keys
.Alt;
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (1)
304
bool 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)
1307
_ctrlSelect = (Control.ModifierKeys &
Keys
.Control) != 0;
1332
bool shiftSelect = (Control.ModifierKeys &
Keys
.Shift) != 0;
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (4)
762
protected override bool ProcessDialogKey(
Keys
keyData)
764
if ((keyData &
Keys
.Modifiers) == 0)
766
switch (keyData &
Keys
.KeyCode)
768
case
Keys
.Enter:
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (4)
267
protected override bool ProcessDialogKey(
Keys
keyData)
269
if ((keyData &
Keys
.Modifiers) == 0 && (keyData &
Keys
.KeyCode) ==
Keys
.Escape)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (3)
1037
if ((e.Modifiers) == 0 && e.KeyCode ==
Keys
.F4)
1046
Keys
modifierKeys = ModifierKeys;
1050
if ((modifierKeys &
Keys
.Control) != 0)
System\Windows\Forms\Design\DesignBindingPicker.cs (5)
1877
protected override bool IsInputKey(
Keys
key)
1879
return (key ==
Keys
.Return) || base.IsInputKey(key);
2092
if (e.KeyData ==
Keys
.Return && SelectedNode is not null)
2101
protected override bool IsInputKey(
Keys
key)
2103
return key ==
Keys
.Return || base.IsInputKey(key);
System\Windows\Forms\Design\DesignerFrame.cs (11)
157
protected override bool ProcessDialogKey(
Keys
keyData)
191
Keys
keycode = (
Keys
)(m.WParamInternal & 0xFFFF);
194
Keys
.Up => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_VSCROLL),
195
Keys
.Down => (SCROLLBAR_COMMAND.SB_LINEDOWN, (MessageId)PInvokeCore.WM_VSCROLL),
196
Keys
.PageUp => (SCROLLBAR_COMMAND.SB_PAGEUP, (MessageId)PInvokeCore.WM_VSCROLL),
197
Keys
.PageDown => (SCROLLBAR_COMMAND.SB_PAGEDOWN, (MessageId)PInvokeCore.WM_VSCROLL),
198
Keys
.Home => (SCROLLBAR_COMMAND.SB_TOP, (MessageId)PInvokeCore.WM_VSCROLL),
199
Keys
.End => (SCROLLBAR_COMMAND.SB_BOTTOM, (MessageId)PInvokeCore.WM_VSCROLL),
200
Keys
.Left => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_HSCROLL),
201
Keys
.Right => (SCROLLBAR_COMMAND.SB_LINEDOWN, (MessageId)PInvokeCore.WM_HSCROLL),
System\Windows\Forms\Design\DockEditor.DockUI.cs (2)
246
protected override RadioButton ProcessTabKey(
Keys
keyData)
252
i += (keyData &
Keys
.Shift) == 0 ? 1 : -1;
System\Windows\Forms\Design\FormatStringDialog.cs (5)
235
protected override bool ProcessDialogKey(
Keys
keyData)
237
if ((keyData &
Keys
.Modifiers) != 0)
242
switch (keyData &
Keys
.KeyCode)
244
case
Keys
.Enter:
249
case
Keys
.Escape:
System\Windows\Forms\Design\MaskedTextBoxTextEditorDropDown.cs (2)
75
protected override bool ProcessDialogKey(
Keys
keyData)
77
if (keyData ==
Keys
.Escape)
System\Windows\Forms\Design\NavigationalTableLayoutPanel.cs (3)
28
protected override bool ProcessDialogKey(
Keys
keyData)
30
bool down = keyData ==
Keys
.Down;
31
bool up = keyData ==
Keys
.Up;
System\Windows\Forms\Design\NewItemsContextMenuStrip.cs (5)
71
protected override bool ProcessDialogKey(
Keys
keyData)
73
Keys
keyCode = keyData &
Keys
.KeyCode;
76
case
Keys
.Left:
77
case
Keys
.Right:
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
1459
de.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
1660
de.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\PbrsForward.cs (2)
136
if ((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)
19
private static readonly
Keys
[] s_validKeys =
21
Keys
.A,
Keys
.B,
Keys
.C,
Keys
.D,
Keys
.D0,
Keys
.D1,
Keys
.D2,
Keys
.D3,
Keys
.D4,
Keys
.D5,
Keys
.D6,
Keys
.D7,
22
Keys
.D8,
Keys
.D9,
Keys
.Delete,
Keys
.Down,
Keys
.E,
Keys
.End,
Keys
.F,
Keys
.F1,
Keys
.F10,
Keys
.F11,
23
Keys
.F12,
Keys
.F13,
Keys
.F14,
Keys
.F15,
Keys
.F16,
Keys
.F17,
Keys
.F18,
Keys
.F19,
Keys
.F2,
Keys
.F20,
24
Keys
.F21,
Keys
.F22,
Keys
.F23,
Keys
.F24,
Keys
.F3,
Keys
.F4,
Keys
.F5,
Keys
.F6,
Keys
.F7,
Keys
.F8,
Keys
.F9,
25
Keys
.G,
Keys
.H,
Keys
.I,
Keys
.Insert,
Keys
.J,
Keys
.K,
Keys
.L,
Keys
.Left,
Keys
.M,
Keys
.N,
Keys
.NumLock,
26
Keys
.NumPad0,
Keys
.NumPad1,
Keys
.NumPad2,
Keys
.NumPad3,
Keys
.NumPad4,
Keys
.NumPad5,
Keys
.NumPad6,
27
Keys
.NumPad7,
Keys
.NumPad8,
Keys
.NumPad9,
Keys
.O,
Keys
.OemBackslash,
Keys
.OemClear,
Keys
.OemCloseBrackets,
28
Keys
.Oemcomma,
Keys
.OemMinus,
Keys
.OemOpenBrackets,
Keys
.OemPeriod,
Keys
.OemPipe,
Keys
.Oemplus,
29
Keys
.OemQuestion,
Keys
.OemQuotes,
Keys
.OemSemicolon,
Keys
.Oemtilde,
Keys
.P,
Keys
.Pause,
Keys
.Q,
Keys
.R,
30
Keys
.Right,
Keys
.S,
Keys
.Space,
Keys
.T,
Keys
.Tab,
Keys
.U,
Keys
.Up,
Keys
.V,
Keys
.W,
Keys
.X,
Keys
.Y,
Keys
.Z
45
private
Keys
_unknownKeyCode;
62
private TypeConverter KeysConverter => _keysConverter ??= TypeDescriptor.GetConverter(typeof(
Keys
));
71
if (_currentValue is
Keys
currentKeys && (currentKeys &
Keys
.KeyCode) == 0)
73
return
Keys
.None;
100
if (_unknownKeyCode !=
Keys
.None)
103
_unknownKeyCode =
Keys
.None;
202
foreach (
Keys
keyCode in s_validKeys)
238
private static bool IsValidKey(
Keys
keyCode)
240
Debug.Assert((keyCode &
Keys
.KeyCode) == keyCode);
257
protected override bool ProcessDialogKey(
Keys
keyData)
259
Keys
keyCode = keyData &
Keys
.KeyCode;
260
Keys
keyModifiers = keyData &
Keys
.Modifiers;
264
case
Keys
.Tab:
265
if (keyModifiers ==
Keys
.Shift &&
274
case
Keys
.Left:
275
if ((keyModifiers & (
Keys
.Control |
Keys
.Alt)) == 0)
286
case
Keys
.Right:
287
if ((keyModifiers & (
Keys
.Control |
Keys
.Alt)) == 0)
304
case
Keys
.Escape:
306
(keyModifiers & (
Keys
.Control |
Keys
.Alt)) != 0 ||
326
Keys
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;
331
Keys
keyCode = keys &
Keys
.KeyCode;
332
if (keyCode ==
Keys
.None)
361
Keys
valueKeys =
Keys
.None;
364
valueKeys |=
Keys
.Control;
369
valueKeys |=
Keys
.Alt;
374
valueKeys |=
Keys
.Shift;
377
if (_unknownKeyCode !=
Keys
.None && cmbKeySelectedIndex == 0)
383
valueKeys |= s_validKeys[_unknownKeyCode ==
Keys
.None ? cmbKeySelectedIndex : cmbKeySelectedIndex - 1];
System\Windows\Forms\Design\StandardMenuStripVerb.cs (41)
88
Keys
[][] 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]
157
Keys
shortcut = menuItemShortcuts[j][i];
158
if ((item is ToolStripMenuItem menuItem) && shortcut !=
Keys
.None)
System\Windows\Forms\Design\StringCollectionEditor.StringCollectionForm.cs (1)
38
if (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)
2285
de.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (5)
352
bool removeSel = (Control.ModifierKeys & (
Keys
.Control |
Keys
.Shift)) > 0;
381
bool shiftPressed = (Control.ModifierKeys &
Keys
.Shift) > 0;
450
else if (shiftPressed || (Control.ModifierKeys &
Keys
.Control) > 0)
886
e.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (2)
686
bool shiftPressed = (Control.ModifierKeys &
Keys
.Shift) > 0;
731
bool shiftPressed = (Control.ModifierKeys &
Keys
.Shift) > 0;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
2651
e.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
2666
e.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (19)
1076
case
Keys
.Up:
1081
case
Keys
.Down:
1084
case
Keys
.Escape:
1087
case
Keys
.Return:
1109
if (e.KeyCode ==
Keys
.A && (e.KeyData &
Keys
.Control) != 0)
1560
protected override bool IsInputKey(
Keys
keyData)
1562
switch (keyData &
Keys
.KeyCode)
1564
case
Keys
.Return:
1575
protected override bool ProcessDialogKey(
Keys
keyData)
1710
protected override bool ProcessDialogKey(
Keys
keyData)
1715
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
1717
Keys
keyCode = keyData &
Keys
.KeyCode;
1720
case
Keys
.Tab:
1721
retVal = ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None);
System.Windows.Forms.Design.Tests (2)
EnsureEditorsTests.cs (1)
64
[InlineData(typeof(
Keys
), typeof(ShortcutKeysEditor))]
System\Windows\Forms\Design\MaskedTextBoxTextEditorDropDownTests.cs (1)
36
bool processDialogKey = dropDown.TestAccessor().Dynamic.ProcessDialogKey(
Keys
.Escape);
System.Windows.Forms.Tests (1231)
KeyboardTooltipStateMachineTests.cs (18)
51
[InlineData(
Keys
.ControlKey)]
52
[InlineData(
Keys
.Escape)]
53
[InlineData(
Keys
.ControlKey |
Keys
.ShiftKey |
Keys
.F10)]
54
public void KeyboardTooltipStateMachine_DismissalKeyUp_NonPersistent_NotDismissed(
Keys
keys)
80
[InlineData(
Keys
.ControlKey, true)]
81
[InlineData(
Keys
.Escape, true)]
82
[InlineData(
Keys
.ControlKey |
Keys
.ShiftKey |
Keys
.F10, true)]
83
[InlineData(
Keys
.ControlKey, false)]
84
[InlineData(
Keys
.Escape, false)]
85
[InlineData(
Keys
.ControlKey |
Keys
.ShiftKey |
Keys
.F10, false)]
86
public void KeyboardTooltipStateMachine_DismissalKeyUp(
Keys
keys, bool isPersistent)
112
public void SimulateKeyUp(
Keys
keys) => base.OnKeyUp(new KeyEventArgs(keys));
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (8)
760
KeyboardSimulator.KeyPress(listView,
Keys
.Up);
761
KeyboardSimulator.KeyPress(listView,
Keys
.Left);
766
KeyboardSimulator.KeyPress(listView,
Keys
.Left);
772
KeyboardSimulator.KeyPress(listView,
Keys
.Right);
777
KeyboardSimulator.KeyPress(listView,
Keys
.Right);
810
KeyboardSimulator.KeyPress(listView,
Keys
.Down);
815
KeyboardSimulator.KeyPress(listView,
Keys
.Up);
825
KeyboardSimulator.KeyPress(listView,
Keys
.Left);
System\Windows\Forms\ButtonBaseTests.cs (74)
5483
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Cancel), false, false };
5484
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Enter), false, false };
5485
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Space), true, expectedIsHandleCreated };
5528
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Cancel), false };
5529
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Enter), false };
5530
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Space), true };
5574
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Cancel), false, 0 };
5575
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Enter), false, 0 };
5576
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Space), true, 1 };
5632
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Cancel), false };
5633
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Enter), false };
5634
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Space), true };
5686
[InlineData(FlatStyle.Flat,
Keys
.Cancel, 0)]
5687
[InlineData(FlatStyle.Flat,
Keys
.Enter, 0)]
5688
[InlineData(FlatStyle.Flat,
Keys
.Space, 0)]
5689
[InlineData(FlatStyle.Popup,
Keys
.Cancel, 0)]
5690
[InlineData(FlatStyle.Popup,
Keys
.Enter, 0)]
5691
[InlineData(FlatStyle.Popup,
Keys
.Space, 0)]
5692
[InlineData(FlatStyle.Standard,
Keys
.Cancel, 0)]
5693
[InlineData(FlatStyle.Standard,
Keys
.Enter, 0)]
5694
[InlineData(FlatStyle.Standard,
Keys
.Space, 0)]
5695
[InlineData(FlatStyle.System,
Keys
.Cancel, 0)]
5696
[InlineData(FlatStyle.System,
Keys
.Enter, 0)]
5697
[InlineData(FlatStyle.System,
Keys
.Space, 0)]
5698
public void ButtonBase_OnKeyDown_GetState_ReturnsExpected(FlatStyle flatStyle,
Keys
key, int expected)
5710
[InlineData(FlatStyle.Flat,
Keys
.Cancel, 0)]
5711
[InlineData(FlatStyle.Flat,
Keys
.Enter, 0)]
5712
[InlineData(FlatStyle.Flat,
Keys
.Space, 0)]
5713
[InlineData(FlatStyle.Popup,
Keys
.Cancel, 0)]
5714
[InlineData(FlatStyle.Popup,
Keys
.Enter, 0)]
5715
[InlineData(FlatStyle.Popup,
Keys
.Space, 0)]
5716
[InlineData(FlatStyle.Standard,
Keys
.Cancel, 0)]
5717
[InlineData(FlatStyle.Standard,
Keys
.Enter, 0)]
5718
[InlineData(FlatStyle.Standard,
Keys
.Space, 0)]
5719
[InlineData(FlatStyle.System,
Keys
.Cancel, 0)]
5720
[InlineData(FlatStyle.System,
Keys
.Enter, 0)]
5721
[InlineData(FlatStyle.System,
Keys
.Space, 0)]
5722
public void ButtonBase_OnKeyDown_MouseDownGetState_ReturnsExpected(FlatStyle flatStyle,
Keys
key, int expected)
5747
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.None) };
5748
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Cancel) };
5749
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Enter) };
5750
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Space) };
5797
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Cancel), 0, expectedIsHandleCreated };
5798
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Enter), 1, expectedIsHandleCreated };
5799
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Space), 1, expectedIsHandleCreated };
5902
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Cancel), 0, expectedCallCount };
5903
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Enter), 1, expectedCallCount };
5904
yield return new object[] { flatStyle, enabled, new KeyEventArgs(
Keys
.Space), 1, expectedCallCount };
5965
[InlineData(FlatStyle.Flat,
Keys
.Cancel, 0)]
5966
[InlineData(FlatStyle.Flat,
Keys
.Enter, 0)]
5967
[InlineData(FlatStyle.Flat,
Keys
.Space, 0)]
5968
[InlineData(FlatStyle.Popup,
Keys
.Cancel, 0)]
5969
[InlineData(FlatStyle.Popup,
Keys
.Enter, 0)]
5970
[InlineData(FlatStyle.Popup,
Keys
.Space, 0)]
5971
[InlineData(FlatStyle.Standard,
Keys
.Cancel, 0)]
5972
[InlineData(FlatStyle.Standard,
Keys
.Enter, 0)]
5973
[InlineData(FlatStyle.Standard,
Keys
.Space, 0)]
5974
[InlineData(FlatStyle.System,
Keys
.Cancel, 0)]
5975
[InlineData(FlatStyle.System,
Keys
.Enter, 0)]
5976
[InlineData(FlatStyle.System,
Keys
.Space, 0)]
5977
public void ButtonBase_OnKeyUp_GetState_ReturnsExpected(FlatStyle flatStyle,
Keys
key, int expected)
5989
[InlineData(FlatStyle.Flat,
Keys
.Cancel, 0)]
5990
[InlineData(FlatStyle.Flat,
Keys
.Enter, 0)]
5991
[InlineData(FlatStyle.Flat,
Keys
.Space, 0)]
5992
[InlineData(FlatStyle.Popup,
Keys
.Cancel, 0)]
5993
[InlineData(FlatStyle.Popup,
Keys
.Enter, 0)]
5994
[InlineData(FlatStyle.Popup,
Keys
.Space, 0)]
5995
[InlineData(FlatStyle.Standard,
Keys
.Cancel, 0)]
5996
[InlineData(FlatStyle.Standard,
Keys
.Enter, 0)]
5997
[InlineData(FlatStyle.Standard,
Keys
.Space, 0)]
5998
[InlineData(FlatStyle.System,
Keys
.Cancel, 0)]
5999
[InlineData(FlatStyle.System,
Keys
.Enter, 0)]
6000
[InlineData(FlatStyle.System,
Keys
.Space, 0)]
6001
public void ButtonBase_OnKeyUp_MouseDownGetState_ReturnsExpected(FlatStyle flatStyle,
Keys
key, int expected)
System\Windows\Forms\ComboBoxTests.cs (8)
1722
tb.ProcessCmdKey(ref message,
Keys
.Control |
Keys
.Back);
2596
[InlineData(
Keys
.Up, 9, 9)]
2597
[InlineData(
Keys
.Down, 9, 0)]
2598
public void ComboBox_Select_Item_By_Key(
Keys
key, int expectedKeyPressesCount, int selectedIndex)
2774
public void OnKeyUp() => base.OnKeyUp(new KeyEventArgs(
Keys
.Left));
2898
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
2932
public new bool ProcessCmdKey(ref Message msg,
Keys
keyData) => base.ProcessCmdKey(ref msg, keyData);
System\Windows\Forms\ControlTests.cs (3)
1232
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
1392
public new bool ProcessCmdKey(ref Message msg,
Keys
keyData) => base.ProcessCmdKey(ref msg, keyData);
1396
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ControlTests.Methods.cs (260)
4376
public void Control_IsInputChar_InvokeWithoutHandle_ReturnsExpected(
Keys
keyData, bool expected)
4385
public void Control_IsInputChar_InvokeWithHandle_ReturnsExpected(
Keys
keyData, bool expected)
4395
yield return new object[] {
Keys
.Tab, false };
4396
yield return new object[] {
Keys
.Up, false };
4397
yield return new object[] {
Keys
.Down, false };
4398
yield return new object[] {
Keys
.Left, false };
4399
yield return new object[] {
Keys
.Right, false };
4400
yield return new object[] {
Keys
.Return, false };
4401
yield return new object[] {
Keys
.Escape, false };
4402
yield return new object[] {
Keys
.A, false };
4403
yield return new object[] {
Keys
.C, false };
4404
yield return new object[] {
Keys
.Insert, false };
4405
yield return new object[] {
Keys
.Space, false };
4406
yield return new object[] {
Keys
.Home, false };
4407
yield return new object[] {
Keys
.End, false };
4408
yield return new object[] {
Keys
.Back, false };
4409
yield return new object[] {
Keys
.Next, false };
4410
yield return new object[] {
Keys
.Prior, false };
4411
yield return new object[] {
Keys
.Delete, false };
4412
yield return new object[] {
Keys
.D0, false };
4413
yield return new object[] {
Keys
.NumPad0, false };
4414
yield return new object[] {
Keys
.F1, false };
4415
yield return new object[] {
Keys
.F2, false };
4416
yield return new object[] {
Keys
.F3, false };
4417
yield return new object[] {
Keys
.F4, false };
4418
yield return new object[] {
Keys
.F10, false };
4419
yield return new object[] {
Keys
.RButton, false };
4420
yield return new object[] {
Keys
.PageUp, false };
4421
yield return new object[] {
Keys
.PageDown, false };
4422
yield return new object[] {
Keys
.Menu, false };
4423
yield return new object[] {
Keys
.None, false };
4425
yield return new object[] {
Keys
.Control |
Keys
.Tab, false };
4426
yield return new object[] {
Keys
.Control |
Keys
.Up, false };
4427
yield return new object[] {
Keys
.Control |
Keys
.Down, false };
4428
yield return new object[] {
Keys
.Control |
Keys
.Left, false };
4429
yield return new object[] {
Keys
.Control |
Keys
.Right, false };
4430
yield return new object[] {
Keys
.Control |
Keys
.Return, false };
4431
yield return new object[] {
Keys
.Control |
Keys
.Escape, false };
4432
yield return new object[] {
Keys
.Control |
Keys
.A, false };
4433
yield return new object[] {
Keys
.Control |
Keys
.C, false };
4434
yield return new object[] {
Keys
.Control |
Keys
.Insert, false };
4435
yield return new object[] {
Keys
.Control |
Keys
.Space, false };
4436
yield return new object[] {
Keys
.Control |
Keys
.Home, false };
4437
yield return new object[] {
Keys
.Control |
Keys
.End, false };
4438
yield return new object[] {
Keys
.Control |
Keys
.Back, false };
4439
yield return new object[] {
Keys
.Control |
Keys
.Next, false };
4440
yield return new object[] {
Keys
.Control |
Keys
.Prior, false };
4441
yield return new object[] {
Keys
.Control |
Keys
.Delete, false };
4442
yield return new object[] {
Keys
.Control |
Keys
.D0, false };
4443
yield return new object[] {
Keys
.Control |
Keys
.NumPad0, false };
4444
yield return new object[] {
Keys
.Control |
Keys
.F1, false };
4445
yield return new object[] {
Keys
.Control |
Keys
.F2, false };
4446
yield return new object[] {
Keys
.Control |
Keys
.F3, false };
4447
yield return new object[] {
Keys
.Control |
Keys
.F4, false };
4448
yield return new object[] {
Keys
.Control |
Keys
.F10, false };
4449
yield return new object[] {
Keys
.Control |
Keys
.RButton, false };
4450
yield return new object[] {
Keys
.Control |
Keys
.PageUp, false };
4451
yield return new object[] {
Keys
.Control |
Keys
.PageDown, false };
4452
yield return new object[] {
Keys
.Control |
Keys
.Menu, false };
4453
yield return new object[] {
Keys
.Control |
Keys
.None, false };
4455
yield return new object[] {
Keys
.Alt |
Keys
.Tab, false };
4456
yield return new object[] {
Keys
.Alt |
Keys
.Up, false };
4457
yield return new object[] {
Keys
.Alt |
Keys
.Down, false };
4458
yield return new object[] {
Keys
.Alt |
Keys
.Left, false };
4459
yield return new object[] {
Keys
.Alt |
Keys
.Right, false };
4460
yield return new object[] {
Keys
.Alt |
Keys
.Return, false };
4461
yield return new object[] {
Keys
.Alt |
Keys
.Escape, false };
4462
yield return new object[] {
Keys
.Alt |
Keys
.A, false };
4463
yield return new object[] {
Keys
.Alt |
Keys
.C, false };
4464
yield return new object[] {
Keys
.Alt |
Keys
.Insert, false };
4465
yield return new object[] {
Keys
.Alt |
Keys
.Space, false };
4466
yield return new object[] {
Keys
.Alt |
Keys
.Home, false };
4467
yield return new object[] {
Keys
.Alt |
Keys
.End, false };
4468
yield return new object[] {
Keys
.Alt |
Keys
.Back, false };
4469
yield return new object[] {
Keys
.Alt |
Keys
.Next, false };
4470
yield return new object[] {
Keys
.Alt |
Keys
.Prior, false };
4471
yield return new object[] {
Keys
.Alt |
Keys
.Delete, false };
4472
yield return new object[] {
Keys
.Alt |
Keys
.D0, false };
4473
yield return new object[] {
Keys
.Alt |
Keys
.NumPad0, false };
4474
yield return new object[] {
Keys
.Alt |
Keys
.F1, false };
4475
yield return new object[] {
Keys
.Alt |
Keys
.F2, false };
4476
yield return new object[] {
Keys
.Alt |
Keys
.F3, false };
4477
yield return new object[] {
Keys
.Alt |
Keys
.F4, false };
4478
yield return new object[] {
Keys
.Alt |
Keys
.F10, false };
4479
yield return new object[] {
Keys
.Alt |
Keys
.RButton, false };
4480
yield return new object[] {
Keys
.Alt |
Keys
.PageUp, false };
4481
yield return new object[] {
Keys
.Alt |
Keys
.PageDown, false };
4482
yield return new object[] {
Keys
.Alt |
Keys
.Menu, false };
4483
yield return new object[] {
Keys
.Alt |
Keys
.None, false };
4488
public void Control_IsInputKey_InvokeWithoutHandle_ReturnsExpected(
Keys
keyData, bool expected)
4497
public void Control_IsInputKey_InvokeWithHandle_ReturnsExpected(
Keys
keyData, bool expected)
5299
yield return new object[] { 0,
Keys
.None, false };
5300
yield return new object[] { 0,
Keys
.A, false };
5301
yield return new object[] { 0,
Keys
.Tab, false };
5302
yield return new object[] { 0,
Keys
.Menu, false };
5303
yield return new object[] { 0,
Keys
.F10, false };
5305
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.None, false };
5306
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.A, false };
5307
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.Tab, true };
5308
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.Menu, true };
5309
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.F10, true };
5311
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.None, false };
5312
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.A, false };
5313
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.Tab, true };
5314
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.Menu, true };
5315
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.F10, true };
5317
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.None, false };
5318
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.A, false };
5319
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.Tab, false };
5320
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.Menu, false };
5321
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.F10, false };
5323
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.None, false };
5324
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.A, false };
5325
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.Tab, false };
5326
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.Menu, false };
5327
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.F10, false };
5329
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.None, true };
5330
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.A, true };
5331
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.Tab, true };
5332
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.Menu, true };
5333
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.F10, true };
5335
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.None, false };
5336
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.A, false };
5337
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.Tab, false };
5338
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.Menu, false };
5339
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.F10, false };
5341
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.None, false };
5342
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.A, false };
5343
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.Tab, false };
5344
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.Menu, false };
5345
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.F10, false };
5347
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.None, false };
5348
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.A, false };
5349
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.Tab, false };
5350
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.Menu, false };
5351
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.F10, false };
5356
public void Control_PreProcessMessage_Invoke_ReturnsExpected(int windowMsg,
Keys
keys, bool expectedIsHandleCreated)
5370
public void Control_PreProcessMessage_InvokeWithParent_ReturnsExpected(int windowMsg,
Keys
keys, bool expectedIsHandleCreated)
5388
yield return new object[] { 0,
Keys
.None, false, false, false, false, false, false, 0, 0, 0, 0, 0 };
5389
yield return new object[] { 0,
Keys
.A, false, false, false, false, false, false, 0, 0, 0, 0, 0 };
5391
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.None, true, false, false, false, false, true, 1, 0, 0, 0, 0 };
5392
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.None, false, true, false, false, false, false, 1, 1, 0, 0, 0 };
5393
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.None, false, false, true, false, false, true, 1, 1, 1, 0, 0 };
5394
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.None, false, false, false, false, false, false, 1, 1, 1, 0, 0 };
5395
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.A, true, false, false, false, false, true, 1, 0, 0, 0, 0 };
5396
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.A, false, true, false, false, false, false, 1, 1, 0, 0, 0 };
5397
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.A, false, false, true, false, false, true, 1, 1, 1, 0, 0 };
5398
yield return new object[] { (int)PInvokeCore.WM_KEYDOWN,
Keys
.A, false, false, false, false, false, false, 1, 1, 1, 0, 0 };
5400
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.None, true, false, false, false, false, true, 1, 0, 0, 0, 0 };
5401
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.None, false, true, false, false, false, false, 1, 1, 0, 0, 0 };
5402
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.None, false, false, true, false, false, true, 1, 1, 1, 0, 0 };
5403
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.None, false, false, false, false, false, false, 1, 1, 1, 0, 0 };
5404
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.A, true, false, false, false, false, true, 1, 0, 0, 0, 0 };
5405
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.A, false, true, false, false, false, false, 1, 1, 0, 0, 0 };
5406
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.A, false, false, true, false, false, true, 1, 1, 1, 0, 0 };
5407
yield return new object[] { (int)PInvokeCore.WM_SYSKEYDOWN,
Keys
.A, false, false, false, false, false, false, 1, 1, 1, 0, 0 };
5409
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.None, false, false, false, true, false, false, 0, 0, 0, 1, 0 };
5410
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.None, false, false, false, true, true, false, 0, 0, 0, 1, 0 };
5411
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.None, false, false, false, false, true, true, 0, 0, 0, 1, 1 };
5412
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.None, false, false, false, false, false, false, 0, 0, 0, 1, 1 };
5413
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.A, false, false, false, true, false, false, 0, 0, 0, 1, 0 };
5414
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.A, false, false, false, true, true, false, 0, 0, 0, 1, 0 };
5415
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.A, false, false, false, false, true, true, 0, 0, 0, 1, 1 };
5416
yield return new object[] { (int)PInvokeCore.WM_CHAR,
Keys
.A, false, false, false, false, false, false, 0, 0, 0, 1, 1 };
5418
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.None, false, false, false, true, false, false, 0, 0, 0, 0, 1 };
5419
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.None, false, false, false, true, true, true, 0, 0, 0, 0, 1 };
5420
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.None, false, false, false, false, true, true, 0, 0, 0, 0, 1 };
5421
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.None, false, false, false, false, false, false, 0, 0, 0, 0, 1 };
5422
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.A, false, false, false, true, false, false, 0, 0, 0, 0, 1 };
5423
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.A, false, false, false, true, true, true, 0, 0, 0, 0, 1 };
5424
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.A, false, false, false, false, true, true, 0, 0, 0, 0, 1 };
5425
yield return new object[] { (int)PInvokeCore.WM_SYSCHAR,
Keys
.A, false, false, false, false, false, false, 0, 0, 0, 0, 1 };
5427
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.None, false, false, false, false, false, false, 0, 0, 0, 0, 0 };
5428
yield return new object[] { (int)PInvokeCore.WM_KEYUP,
Keys
.A, false, false, false, false, false, false, 0, 0, 0, 0, 0 };
5430
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.None, false, false, false, false, false, false, 0, 0, 0, 0, 0 };
5431
yield return new object[] { (int)PInvokeCore.WM_SYSKEYUP,
Keys
.A, false, false, false, false, false, false, 0, 0, 0, 0, 0 };
5436
public 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)
5439
bool processCmdKeyAction(Message actualM,
Keys
actualKeyData)
5448
bool isInputKeyAction(
Keys
actualKeyData)
5456
bool processDialogKeyAction(
Keys
actualKeyData)
5511
public Func<
Keys
, bool> IsInputKeyAction { get; set; }
5513
protected override bool IsInputKey(
Keys
keyData) => IsInputKeyAction(keyData);
5518
public Func<Message,
Keys
, bool> ProcessCmdKeyAction { get; set; }
5520
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData) => ProcessCmdKeyAction(msg, keyData);
5526
public Func<
Keys
, bool> ProcessDialogKeyAction { get; set; }
5528
protected override bool ProcessDialogKey(
Keys
keyData) => ProcessDialogKeyAction(keyData);
5536
[InlineData(
Keys
.A)]
5537
public void Control_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(
Keys
keyData)
5546
[InlineData(
Keys
.A)]
5547
public void Control_ProcessCmdKey_InvokeWithParent_ReturnsFalse(
Keys
keyData)
5560
[InlineData(
Keys
.A, true)]
5561
[InlineData(
Keys
.A, false)]
5562
public void Control_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(
Keys
keyData, bool result)
5570
bool action(Message actualMsg,
Keys
actualKeyData)
5638
[InlineData(
Keys
.A)]
5639
public void Control_ProcessDialogKey_InvokeWithoutParent_ReturnsFalse(
Keys
keyData)
5647
[InlineData(
Keys
.A)]
5648
public void Control_ProcessDialogKey_InvokeWithParent_ReturnsFalse(
Keys
keyData)
5660
[InlineData(
Keys
.A, true)]
5661
[InlineData(
Keys
.A, false)]
5662
public void Control_ProcessDialogKey_InvokeWithCustomParent_ReturnsExpected(
Keys
keyData, bool result)
5665
bool action(
Keys
actualKeyData)
System\Windows\Forms\ControlTests.Properties.cs (5)
9275
keyState[(int)
Keys
.LButton] = lState;
9276
keyState[(int)
Keys
.MButton] = mState;
9277
keyState[(int)
Keys
.RButton] = rState;
9278
keyState[(int)
Keys
.XButton1] = xState1;
9279
keyState[(int)
Keys
.XButton2] = xState2;
System\Windows\Forms\DataGridViewCellTests.cs (2)
6491
cell.OnKeyClick(new KeyEventArgs(
Keys
.Space), 0);
6499
cell.OnKeyClick(new KeyEventArgs(
Keys
.Space), 0);
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (45)
1018
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Right, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1019
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Right, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1020
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Left, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1021
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Left, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1022
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Down, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1023
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Down, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1024
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Up, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1025
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Up, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1026
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Home, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1027
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Home, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1028
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.End, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1029
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.End, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1030
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Prior, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged };
1031
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Prior, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged };
1032
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Next, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged };
1033
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Next, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || valueChanged };
1034
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Delete, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1035
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Delete, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1036
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Enter, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1037
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Enter, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1038
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Enter |
Keys
.Shift |
Keys
.Control, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1039
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Enter |
Keys
.Shift |
Keys
.Control, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1040
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.Enter |
Keys
.Shift, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || (multiline && acceptsReturn) };
1041
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.Enter |
Keys
.Shift, dataGridViewWantsInputKey, !dataGridViewWantsInputKey || (multiline && acceptsReturn) };
1042
yield return new object[] { RightToLeft.Yes, valueChanged, multiline, acceptsReturn,
Keys
.A, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1043
yield return new object[] { RightToLeft.No, valueChanged, multiline, acceptsReturn,
Keys
.A, dataGridViewWantsInputKey, !dataGridViewWantsInputKey };
1052
public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_EditingControlWantsInputKey_InvokeEmpty_ReturnsExpected(RightToLeft rightToLeft, bool valueChanged, bool multiline, bool acceptsReturn,
Keys
keyData, bool dataGridViewWantsInputKey, bool expected)
1516
foreach (IntPtr wParam in new IntPtr[] { (IntPtr)
Keys
.Enter, (IntPtr)
Keys
.LineFeed, (IntPtr)
Keys
.A, 2 })
1518
if (wParam != (IntPtr)
Keys
.Enter)
1535
yield return new object[] { (int)PInvokeCore.WM_CHAR, (IntPtr)
Keys
.Enter, '2', handled, true, 0, 0, 0, (IntPtr)
Keys
.Enter };
1536
yield return new object[] { (int)PInvokeCore.WM_CHAR, (IntPtr)
Keys
.Enter, '1', handled, true, 0, 0, 0, (IntPtr)
Keys
.Enter };
2077
public Func<Message,
Keys
, bool> ProcessCmdKeyAction { get; set; }
2079
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData) => ProcessCmdKeyAction(msg, keyData);
2085
public Func<
Keys
, bool> ProcessDialogKeyAction { get; set; }
2087
protected override bool ProcessDialogKey(
Keys
keyData) => ProcessDialogKeyAction(keyData);
System\Windows\Forms\KeyEventArgsTests.cs (35)
10
[InlineData(
Keys
.A)]
11
[InlineData(
Keys
.Control |
Keys
.A)]
12
[InlineData(
Keys
.Alt |
Keys
.A)]
13
[InlineData(
Keys
.Shift |
Keys
.A)]
14
[InlineData(
Keys
.Control)]
15
[InlineData(
Keys
.Alt)]
16
[InlineData(
Keys
.Shift)]
17
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.A)]
18
[InlineData((
Keys
)(-1))]
19
[InlineData((
Keys
)(0x5D))]
20
[InlineData((
Keys
)(0xFF))]
21
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift | (
Keys
)(0x5D))]
22
public void Ctor_Keys(
Keys
keyData)
26
Assert.Equal((keyData &
Keys
.Control) ==
Keys
.Control, e.Control);
27
Assert.Equal((keyData &
Keys
.Alt) ==
Keys
.Alt, e.Alt);
28
Assert.Equal((keyData &
Keys
.Shift) ==
Keys
.Shift, e.Shift);
29
Assert.Equal((keyData &
Keys
.Modifiers), e.Modifiers);
30
Assert.Equal((int)(keyData &
Keys
.KeyCode), e.KeyValue);
34
if (Enum.IsDefined(typeof(
Keys
), e.KeyValue))
36
Assert.Equal((
Keys
)e.KeyValue, e.KeyCode);
40
Assert.Equal(
Keys
.None, e.KeyCode);
49
KeyEventArgs e = new(
Keys
.A)
63
KeyEventArgs e = new(
Keys
.A)
System\Windows\Forms\KeysConverterTests.cs (119)
13
[InlineData("Ctrl+Alt+Shift+A",
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.A)]
14
[InlineData("Ctrl+Alt+Shift+F1",
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.F1)]
15
[InlineData("Ctrl+Alt+D",
Keys
.Control |
Keys
.Alt |
Keys
.D)]
16
[InlineData("Ctrl + N",
Keys
.Control |
Keys
.N)]
17
[InlineData("G",
Keys
.G)]
18
[InlineData("None",
Keys
.None)]
19
public void ConvertFrom_ShouldConvertKeys(string input,
Keys
keys)
22
var
result = (
Keys
)converter.ConvertFrom(input);
27
[InlineData("fr-FR", "(aucun)",
Keys
.None)]
28
[InlineData("nb-NO", "None",
Keys
.None)]
29
[InlineData("de-DE", "Ende",
Keys
.End)]
30
public void ConvertFrom_ShouldConvertKeys_Localization(string cultureName, string localizedKeyName,
Keys
expectedKey)
36
var resultFromSpecificCulture = (
Keys
?)converter.ConvertFrom(context: null, culture, localizedKeyName);
47
var resultFromUICulture = (
Keys
?)converter.ConvertFrom(context: null, culture: null, localizedKeyName);
57
[InlineData(
Keys
.None, "(none)")]
58
[InlineData(
Keys
.S, "S")]
59
[InlineData(
Keys
.Control |
Keys
.C, "Ctrl+C")]
60
[InlineData(
Keys
.Control |
Keys
.Add, "Ctrl+Add")]
61
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.D, "Ctrl+Alt+D")]
62
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.A, "Ctrl+Alt+Shift+A")]
63
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.F1, "Ctrl+Alt+Shift+F1")]
64
[InlineData(
Keys
.F2 |
Keys
.Shift |
Keys
.Alt |
Keys
.Control, "Ctrl+Alt+Shift+F2")]
65
public void ConvertToString_ShouldConvertKeys(
Keys
keys, string expectedResult)
73
[InlineData("fr-FR",
Keys
.None, "(aucun)")]
74
[InlineData("de-DE",
Keys
.End, "Ende")]
75
public void ConvertToString_ShouldConvertKeys_Localization(string cultureName,
Keys
key, string expectedLocalizedKeyName)
87
yield return new object[] { "fr-FR",
Keys
.None, new Enum[] {
Keys
.None } };
88
yield return new object[] { "de-DE",
Keys
.S, new Enum[] {
Keys
.S } };
89
yield return new object[] { "zh-CN",
Keys
.Control |
Keys
.C, new Enum[] {
Keys
.Control,
Keys
.C } };
90
yield return new object[] { "it-IT",
Keys
.Control |
Keys
.Add, new Enum[] {
Keys
.Control,
Keys
.Add } };
91
yield return new object[] { "ko-KR",
Keys
.Control |
Keys
.Alt |
Keys
.D, new Enum[] {
Keys
.Control,
Keys
.Alt,
Keys
.D } };
92
yield return new object[] { "ru-RU",
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.A, new Enum[] {
Keys
.Control,
Keys
.Alt,
Keys
.Shift,
Keys
.A } };
93
yield return new object[] { "zh-TW",
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.F1, new Enum[] {
Keys
.Control,
Keys
.Alt,
Keys
.Shift,
Keys
.F1 } };
98
public void ConvertToEnumArray_ShouldConvertKeys(string cultureName,
Keys
keys, Enum[] expectedResult)
144
Keys
[] expectedValues =
146
Keys
.None,
Keys
.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,
147
Keys
.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,
148
Keys
.F9,
Keys
.Home,
Keys
.Insert,
Keys
.Next,
Keys
.PageUp,
Keys
.Shift
System\Windows\Forms\LabelTests.cs (2)
749
KeyEventArgs keyEventArgs = new KeyEventArgs(
Keys
.A);
771
KeyEventArgs keyEventArgs = new KeyEventArgs(
Keys
.A);
System\Windows\Forms\ListControlTests.cs (10)
2091
[InlineData(
Keys
.Alt, false)]
2092
[InlineData(
Keys
.Alt |
Keys
.PageUp, false)]
2093
[InlineData(
Keys
.PageUp, true)]
2094
[InlineData(
Keys
.PageDown, true)]
2095
[InlineData(
Keys
.Home, true)]
2096
[InlineData(
Keys
.End, true)]
2097
[InlineData(
Keys
.A, false)]
2098
public void IsInputKey_Invoke_ReturnsExpected(
Keys
keyData, bool expected)
2970
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
System\Windows\Forms\ListViewTests.cs (15)
4520
KeyboardSimulator.KeyDown(control,
Keys
.Space);
4527
[InlineData(
Keys
.Down)]
4528
[InlineData(
Keys
.Up)]
4529
public unsafe void ListView_WmReflectNotify_LVN_KEYDOWN_WithGroups_WithoutSelection_DoesntFocusGroup(
Keys
key)
4593
var
key = key_s == "Keys.Down" ?
Keys
.Down :
Keys
.Up;
4607
[InlineData(
Keys
.Down)]
4608
[InlineData(
Keys
.Up)]
4609
public unsafe void ListView_VirtualMode_WmReflectNotify_LVN_KEYDOWN_WithGroups_DoesNotFocusGroups(
Keys
key)
4667
KeyboardSimulator.KeyDown(control,
Keys
.Space);
4679
KeyboardSimulator.KeyPress(control,
Keys
.Enter);
5473
[InlineData(
Keys
.Right)]
5474
[InlineData(
Keys
.Left)]
5475
public void ListView_LeftRightArrow_DoesNotThrowException(
Keys
key)
System\Windows\Forms\MdiControlStripTests.cs (1)
448
public new bool ProcessCmdKey(ref Message m,
Keys
keyData) => base.ProcessCmdKey(ref m, keyData);
System\Windows\Forms\MenuStripTests.cs (26)
680
[InlineData(
Keys
.A)]
681
public void MenuStirp_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(
Keys
keyData)
690
[InlineData(
Keys
.A)]
691
[InlineData(
Keys
.Space)]
692
[InlineData(
Keys
.Control)]
693
[InlineData(
Keys
.Tab)]
694
[InlineData(
Keys
.Control &
Keys
.Tab)]
695
public void MenuStirp_ProcessCmdKey_InvokeWithParent_ReturnsFalse(
Keys
keyData)
708
[InlineData(
Keys
.A, true)]
709
[InlineData(
Keys
.A, false)]
710
[InlineData(
Keys
.Space, true)]
711
[InlineData(
Keys
.Space, false)]
712
[InlineData(
Keys
.Control, true)]
713
[InlineData(
Keys
.Control, false)]
714
[InlineData(
Keys
.Tab, true)]
715
[InlineData(
Keys
.Tab, false)]
716
[InlineData(
Keys
.Control &
Keys
.Tab, true)]
717
[InlineData(
Keys
.Control &
Keys
.Tab, false)]
718
public void MenuStirp_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(
Keys
keyData, bool result)
726
bool action(Message actualMsg,
Keys
actualKeyData)
825
public Func<Message,
Keys
, bool> ProcessCmdKeyAction { get; set; }
827
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData) => ProcessCmdKeyAction(msg, keyData);
944
public new bool ProcessCmdKey(ref Message m,
Keys
keyData) => base.ProcessCmdKey(ref m, keyData);
System\Windows\Forms\PreviewKeyDownEventArgsTests.cs (34)
10
[InlineData(
Keys
.A)]
11
[InlineData(
Keys
.Control |
Keys
.A)]
12
[InlineData(
Keys
.Alt |
Keys
.A)]
13
[InlineData(
Keys
.Shift |
Keys
.A)]
14
[InlineData(
Keys
.Control)]
15
[InlineData(
Keys
.Alt)]
16
[InlineData(
Keys
.Shift)]
17
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.A)]
18
[InlineData((
Keys
)(-1))]
19
[InlineData((
Keys
)(0x5D))]
20
[InlineData((
Keys
)(0xFF))]
21
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift | (
Keys
)(0x5D))]
22
public void Ctor_Keys(
Keys
keyData)
26
Assert.Equal((keyData &
Keys
.Control) ==
Keys
.Control, e.Control);
27
Assert.Equal((keyData &
Keys
.Alt) ==
Keys
.Alt, e.Alt);
28
Assert.Equal((keyData &
Keys
.Shift) ==
Keys
.Shift, e.Shift);
29
Assert.Equal((keyData &
Keys
.Modifiers), e.Modifiers);
30
Assert.Equal((int)(keyData &
Keys
.KeyCode), e.KeyValue);
33
if (Enum.IsDefined(typeof(
Keys
), e.KeyValue))
35
Assert.Equal((
Keys
)e.KeyValue, e.KeyCode);
39
Assert.Equal(
Keys
.None, e.KeyCode);
48
PreviewKeyDownEventArgs e = new(
Keys
.A)
System\Windows\Forms\PrintPreviewDialogTests.cs (13)
9
[InlineData(
Keys
.D1, 1, 1)]
10
[InlineData(
Keys
.D2, 1, 2)]
11
[InlineData(
Keys
.D3, 1, 3)]
12
[InlineData(
Keys
.D4, 2, 2)]
13
[InlineData(
Keys
.D5, 2, 3)]
14
public void PrintPreviewDialog_Hotkey_Ctrl_Digit_AddsRowsAndColumns(
Keys
digitKey, int rows, int columns)
17
testPrintPreviewDialog.TestProcessDialogKey(
Keys
.Control | digitKey);
24
[InlineData(
Keys
.Left)]
25
[InlineData(
Keys
.Right)]
26
[InlineData(
Keys
.Up)]
27
[InlineData(
Keys
.Down)]
28
public void PrintPreviewDialog_Hotkey_ArrowKeys_ReturnsFalse(
Keys
arrowKey)
36
internal bool TestProcessDialogKey(
Keys
keyData)
System\Windows\Forms\SendKeysTests.cs (6)
19
Assert.Equal(
Keys
.ControlKey, form.KeyEvents[0].KeyCode);
20
Assert.Equal(
Keys
.A, form.KeyEvents[1].KeyCode);
21
Assert.Equal(
Keys
.Control, form.KeyEvents[1].Modifiers);
22
Assert.Equal(
Keys
.ControlKey, form.KeyEvents[2].KeyCode);
23
Assert.Equal(
Keys
.C, form.KeyEvents[3].KeyCode);
24
Assert.Equal(
Keys
.Control, form.KeyEvents[3].Modifiers);
System\Windows\Forms\SplitterTests.cs (3)
1820
yield return new object[] { new KeyEventArgs(
Keys
.None) };
1821
yield return new object[] { new KeyEventArgs(
Keys
.Cancel) };
1822
yield return new object[] { new KeyEventArgs(
Keys
.Escape) };
System\Windows\Forms\TabControlTests.cs (150)
3992
yield return new object[] {
Keys
.Tab, false };
3993
yield return new object[] {
Keys
.Return, false };
3994
yield return new object[] {
Keys
.Escape, false };
3995
yield return new object[] {
Keys
.A, false };
3996
yield return new object[] {
Keys
.C, false };
3997
yield return new object[] {
Keys
.Insert, false };
3998
yield return new object[] {
Keys
.Space, false };
3999
yield return new object[] {
Keys
.Home, true };
4000
yield return new object[] {
Keys
.End, true };
4002
yield return new object[] {
Keys
.Back, false };
4003
yield return new object[] {
Keys
.Next, true };
4004
yield return new object[] {
Keys
.Prior, true };
4005
yield return new object[] {
Keys
.Delete, false };
4006
yield return new object[] {
Keys
.D0, false };
4007
yield return new object[] {
Keys
.NumPad0, false };
4008
yield return new object[] {
Keys
.F1, false };
4009
yield return new object[] {
Keys
.F2, false };
4010
yield return new object[] {
Keys
.F3, false };
4011
yield return new object[] {
Keys
.F4, false };
4012
yield return new object[] {
Keys
.RButton, false };
4013
yield return new object[] {
Keys
.PageUp, true };
4014
yield return new object[] {
Keys
.PageDown, true };
4015
yield return new object[] {
Keys
.None, false };
4017
yield return new object[] {
Keys
.Control |
Keys
.Tab, false };
4018
yield return new object[] {
Keys
.Control |
Keys
.Return, false };
4019
yield return new object[] {
Keys
.Control |
Keys
.Escape, false };
4020
yield return new object[] {
Keys
.Control |
Keys
.A, false };
4021
yield return new object[] {
Keys
.Control |
Keys
.C, false };
4022
yield return new object[] {
Keys
.Control |
Keys
.Insert, false };
4023
yield return new object[] {
Keys
.Control |
Keys
.Space, false };
4024
yield return new object[] {
Keys
.Control |
Keys
.Home, true };
4025
yield return new object[] {
Keys
.Control |
Keys
.End, true };
4027
yield return new object[] {
Keys
.Control |
Keys
.Back, false };
4028
yield return new object[] {
Keys
.Control |
Keys
.Next, true };
4029
yield return new object[] {
Keys
.Control |
Keys
.Prior, true };
4030
yield return new object[] {
Keys
.Control |
Keys
.Delete, false };
4031
yield return new object[] {
Keys
.Control |
Keys
.D0, false };
4032
yield return new object[] {
Keys
.Control |
Keys
.NumPad0, false };
4033
yield return new object[] {
Keys
.Control |
Keys
.F1, false };
4034
yield return new object[] {
Keys
.Control |
Keys
.F2, false };
4035
yield return new object[] {
Keys
.Control |
Keys
.F3, false };
4036
yield return new object[] {
Keys
.Control |
Keys
.F4, false };
4037
yield return new object[] {
Keys
.Control |
Keys
.RButton, false };
4038
yield return new object[] {
Keys
.Control |
Keys
.PageUp, true };
4039
yield return new object[] {
Keys
.Control |
Keys
.PageDown, true };
4040
yield return new object[] {
Keys
.Control |
Keys
.None, false };
4042
yield return new object[] {
Keys
.Alt |
Keys
.Tab, false };
4043
yield return new object[] {
Keys
.Alt |
Keys
.Up, false };
4044
yield return new object[] {
Keys
.Alt |
Keys
.Down, false };
4045
yield return new object[] {
Keys
.Alt |
Keys
.Left, false };
4046
yield return new object[] {
Keys
.Alt |
Keys
.Right, false };
4047
yield return new object[] {
Keys
.Alt |
Keys
.Return, false };
4048
yield return new object[] {
Keys
.Alt |
Keys
.Escape, false };
4049
yield return new object[] {
Keys
.Alt |
Keys
.A, false };
4050
yield return new object[] {
Keys
.Alt |
Keys
.C, false };
4051
yield return new object[] {
Keys
.Alt |
Keys
.Insert, false };
4052
yield return new object[] {
Keys
.Alt |
Keys
.Space, false };
4053
yield return new object[] {
Keys
.Alt |
Keys
.Home, false };
4054
yield return new object[] {
Keys
.Alt |
Keys
.End, false };
4056
yield return new object[] {
Keys
.Alt |
Keys
.Back, false };
4057
yield return new object[] {
Keys
.Alt |
Keys
.Next, false };
4058
yield return new object[] {
Keys
.Alt |
Keys
.Prior, false };
4059
yield return new object[] {
Keys
.Alt |
Keys
.Delete, false };
4060
yield return new object[] {
Keys
.Alt |
Keys
.D0, false };
4061
yield return new object[] {
Keys
.Alt |
Keys
.NumPad0, false };
4062
yield return new object[] {
Keys
.Alt |
Keys
.F1, false };
4063
yield return new object[] {
Keys
.Alt |
Keys
.F2, false };
4064
yield return new object[] {
Keys
.Alt |
Keys
.F3, false };
4065
yield return new object[] {
Keys
.Alt |
Keys
.F4, false };
4066
yield return new object[] {
Keys
.Alt |
Keys
.RButton, false };
4067
yield return new object[] {
Keys
.Alt |
Keys
.PageUp, false };
4068
yield return new object[] {
Keys
.Alt |
Keys
.PageDown, false };
4069
yield return new object[] {
Keys
.Alt |
Keys
.None, false };
4074
[InlineData(
Keys
.Up, false)]
4075
[InlineData(
Keys
.Down, false)]
4076
[InlineData(
Keys
.Left, false)]
4077
[InlineData(
Keys
.Right, false)]
4078
[InlineData(
Keys
.Control |
Keys
.Up, false)]
4079
[InlineData(
Keys
.Control |
Keys
.Down, false)]
4080
[InlineData(
Keys
.Control |
Keys
.Left, false)]
4081
[InlineData(
Keys
.Control |
Keys
.Right, false)]
4082
public void TabControl_IsInputKey_InvokeWithoutHandle_ReturnsExpected(
Keys
keyData, bool expected)
4091
[InlineData(
Keys
.Up, true)]
4092
[InlineData(
Keys
.Down, true)]
4093
[InlineData(
Keys
.Left, true)]
4094
[InlineData(
Keys
.Right, true)]
4095
[InlineData(
Keys
.Control |
Keys
.Up, true)]
4096
[InlineData(
Keys
.Control |
Keys
.Down, true)]
4097
[InlineData(
Keys
.Control |
Keys
.Left, true)]
4098
[InlineData(
Keys
.Control |
Keys
.Right, true)]
4099
public void TabControl_IsInputKey_InvokeWithHandle_ReturnsExpected(
Keys
keyData, bool expected)
5791
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
System\Windows\Forms\ToolStripButtonTests.cs (11)
1531
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
1558
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
1585
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
1610
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
1637
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
1664
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
1670
[InlineData(
Keys
.A)]
1671
[InlineData(
Keys
.None)]
1672
[InlineData((
Keys
.None - 1))]
1673
public void ToolStripButton_ProcessDialogKey_UnknownKey_ReturnsFalse(
Keys
keyData)
1756
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripControlHostTests.cs (40)
4065
c.OnKeyDown(new KeyEventArgs(
Keys
.A));
4071
c.OnKeyUp(new KeyEventArgs(
Keys
.A));
4192
[InlineData(
Keys
.None)]
4193
[InlineData(
Keys
.A)]
4194
[InlineData(
Keys
.Enter)]
4195
[InlineData(
Keys
.Space)]
4196
[InlineData((
Keys
.None - 1))]
4197
public void ToolStripControlHost_ProcessCmdKey_Invoke_ReturnsFalse(
Keys
keyData)
4207
[InlineData(
Keys
.A, true)]
4208
[InlineData(
Keys
.A, false)]
4209
public void ToolStripControlHost_ProcessCmdKey_InvokeWithCustomControl_ReturnsFalse(
Keys
keyData, bool result)
4212
bool action(Message actualMsg,
Keys
actualKeyData)
4233
[InlineData(
Keys
.None)]
4234
[InlineData(
Keys
.A)]
4235
[InlineData(
Keys
.Enter)]
4236
[InlineData(
Keys
.Space)]
4237
[InlineData((
Keys
.None - 1))]
4238
public void ToolStripControlHost_ProcessCmdKey_InvokeDisposed_ReturnsFalse(
Keys
keyData)
4249
[InlineData(
Keys
.None)]
4250
[InlineData(
Keys
.A)]
4251
[InlineData(
Keys
.Enter)]
4252
[InlineData(
Keys
.Space)]
4253
[InlineData((
Keys
.None - 1))]
4254
public void ToolStripControlHost_ProcessDialogKey_Invoke_ReturnsFalse(
Keys
keyData)
4267
[InlineData(
Keys
.A, true)]
4268
[InlineData(
Keys
.A, false)]
4269
public void ToolStripControlHost_ProcessDialogKey_InvokeWithCustomControl_ReturnsFalse(
Keys
keyData, bool result)
4272
bool action(
Keys
actualKeyData)
4293
[InlineData(
Keys
.None)]
4294
[InlineData(
Keys
.A)]
4295
[InlineData(
Keys
.Enter)]
4296
[InlineData(
Keys
.Space)]
4297
[InlineData((
Keys
.None - 1))]
4298
public void ToolStripControlHost_ProcessDialogKey_InvokeDisposed_ReturnsFalse(
Keys
keyData)
4372
public Func<Message,
Keys
, bool> ProcessCmdKeyAction { get; set; }
4374
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData) => ProcessCmdKeyAction(msg, keyData);
4376
public Func<
Keys
, bool> ProcessDialogKeyAction { get; set; }
4378
protected override bool ProcessDialogKey(
Keys
keyData) => ProcessDialogKeyAction(keyData);
4701
public new bool ProcessCmdKey(ref Message m,
Keys
keyData) => base.ProcessCmdKey(ref m, keyData);
4703
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripDropDownTests.cs (1)
5234
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripItemTests.cs (24)
10356
[InlineData(
Keys
.None)]
10357
[InlineData(
Keys
.A)]
10358
[InlineData(
Keys
.Enter)]
10359
[InlineData(
Keys
.Space)]
10360
[InlineData((
Keys
.None - 1))]
10361
public void ToolStripItem_IsInputKey_Invoke_ReturnsFalse(
Keys
keyData)
13945
[InlineData(
Keys
.None)]
13946
[InlineData(
Keys
.A)]
13947
[InlineData(
Keys
.Enter)]
13948
[InlineData(
Keys
.Space)]
13949
[InlineData((
Keys
.None - 1))]
13950
public void ToolStripItem_ProcessCmdKey_Invoke_ReturnsFalse(
Keys
keyData)
13977
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
14004
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
14031
Assert.True(item.ProcessDialogKey(
Keys
.Enter));
14037
[InlineData(
Keys
.Space)]
14038
[InlineData(
Keys
.A)]
14039
[InlineData(
Keys
.None)]
14040
[InlineData((
Keys
.None - 1))]
14041
public void ToolStripItem_ProcessDialogKey_UnknownKey_ReturnsFalse(
Keys
keyData)
15480
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
15529
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
15599
public new bool ProcessCmdKey(ref Message m,
Keys
keyData) => base.ProcessCmdKey(ref m, keyData);
15601
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\ToolStripMenuItemTests.cs (33)
89
Assert.Equal(
Keys
.None, item.ShortcutKeys);
124
[InlineData(
Keys
.F1)]
125
[InlineData(
Keys
.None)]
126
[InlineData(
Keys
.Control |
Keys
.Add)]
127
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.D)]
128
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.A)]
129
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift |
Keys
.F1)]
130
public void ToolStripMenuItem_SetShortcutKeys(
Keys
keys)
138
[InlineData(
Keys
.A)]
139
[InlineData(
Keys
.Control)]
140
[InlineData(
Keys
.Control |
Keys
.Alt)]
141
[InlineData(
Keys
.Control |
Keys
.Alt |
Keys
.Shift)]
142
public void ToolStripMenuItem_SetShortcutKeys_ThrowsInvalidEnumArgumentException(
Keys
keys)
158
item.ShortcutKeys =
Keys
.Control |
Keys
.Shift |
Keys
.K;
228
Keys
shortcutKeys =
Keys
.Control |
Keys
.A;
299
ShortcutKeys =
Keys
.Control |
Keys
.A,
System\Windows\Forms\ToolStripTests.cs (35)
4818
toolStrip.TestAccessor().Dynamic.LastKeyData =
Keys
.Tab;
4839
toolStrip.TestAccessor().Dynamic.LastKeyData =
Keys
.Tab;
4864
toolStrip.TestAccessor().Dynamic.LastKeyData =
Keys
.Shift |
Keys
.Tab;
4885
toolStrip.TestAccessor().Dynamic.LastKeyData =
Keys
.Shift |
Keys
.Tab;
6902
[InlineData(
Keys
.A)]
6903
public void ToolStrip_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(
Keys
keyData)
6912
[InlineData(
Keys
.A)]
6913
[InlineData(
Keys
.Space)]
6914
[InlineData(
Keys
.Control)]
6915
[InlineData(
Keys
.Tab)]
6916
[InlineData(
Keys
.Control &
Keys
.Tab)]
6917
public void ToolStrip_ProcessCmdKey_InvokeWithParent_ReturnsFalse(
Keys
keyData)
6930
[InlineData(
Keys
.A, true)]
6931
[InlineData(
Keys
.A, false)]
6932
[InlineData(
Keys
.Space, true)]
6933
[InlineData(
Keys
.Space, false)]
6934
[InlineData(
Keys
.Control, true)]
6935
[InlineData(
Keys
.Control, false)]
6936
[InlineData(
Keys
.Tab, true)]
6937
[InlineData(
Keys
.Tab, false)]
6938
[InlineData(
Keys
.Control &
Keys
.Tab, true)]
6939
[InlineData(
Keys
.Control &
Keys
.Tab, false)]
6940
public void ToolStrip_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(
Keys
keyData, bool result)
6948
bool action(Message actualMsg,
Keys
actualKeyData)
7297
toolStrip.TestAccessor().Dynamic.LastKeyData =
Keys
.Left;
7470
public Func<Message,
Keys
, bool> ProcessCmdKeyAction { get; set; }
7472
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData) => ProcessCmdKeyAction(msg, keyData);
7620
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
7676
public new bool ProcessCmdKey(ref Message m,
Keys
keyData) => base.ProcessCmdKey(ref m, keyData);
7678
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
System\Windows\Forms\TreeViewTests.cs (26)
5730
yield return new object[] { new KeyEventArgs(
Keys
.None) };
5731
yield return new object[] { new KeyEventArgs(
Keys
.A) };
5732
yield return new object[] { new KeyEventArgs(
Keys
.Space) };
5733
yield return new object[] { new KeyEventArgs(
Keys
.Control |
Keys
.Space) };
5762
yield return new object[] { false, true, false, new KeyEventArgs(
Keys
.None), 0, 0, false };
5763
yield return new object[] { false, true, false, new KeyEventArgs(
Keys
.A), 0, 0, false };
5764
yield return new object[] { false, true, false, new KeyEventArgs(
Keys
.Space), 1, 1, true };
5765
yield return new object[] { false, true, true, new KeyEventArgs(
Keys
.Space), 1, 0, true };
5766
yield return new object[] { false, true, false, new KeyEventArgs(
Keys
.Control |
Keys
.Space), 1, 1, true };
5767
yield return new object[] { false, true, true, new KeyEventArgs(
Keys
.Control |
Keys
.Space), 1, 0, true };
5769
yield return new object[] { true, true, false, new KeyEventArgs(
Keys
.Space), 0, 0, true };
5770
yield return new object[] { true, false, false, new KeyEventArgs(
Keys
.Space), 0, 0, true };
5771
yield return new object[] { false, false, false, new KeyEventArgs(
Keys
.Space), 0, 0, false };
5895
yield return new object[] { true, new KeyEventArgs(
Keys
.None), true };
5896
yield return new object[] { true, new KeyEventArgs(
Keys
.A), true };
5897
yield return new object[] { true, new KeyEventArgs(
Keys
.Space), true };
5898
yield return new object[] { true, new KeyEventArgs(
Keys
.Control |
Keys
.Space), true };
5900
yield return new object[] { false, new KeyEventArgs(
Keys
.None), false };
5901
yield return new object[] { false, new KeyEventArgs(
Keys
.A), false };
5902
yield return new object[] { false, new KeyEventArgs(
Keys
.Space), true };
5903
yield return new object[] { false, new KeyEventArgs(
Keys
.Control |
Keys
.Space), true };
System\Windows\Forms\UpDownBaseTests.cs (12)
2357
yield return new object[] { true, userEdit, source, new KeyEventArgs(
Keys
.A), 0, 0, 0, false };
2358
yield return new object[] { false, userEdit, source, new KeyEventArgs(
Keys
.A), 0, 0, 0, false };
2359
yield return new object[] { true, userEdit, source, new KeyEventArgs(
Keys
.Up), 1, 0, 0, true };
2360
yield return new object[] { false, userEdit, source, new KeyEventArgs(
Keys
.Up), 0, 0, 0, false };
2361
yield return new object[] { true, userEdit, source, new KeyEventArgs(
Keys
.Down), 0, 1, 0, true };
2362
yield return new object[] { false, userEdit, source, new KeyEventArgs(
Keys
.Down), 0, 0, 0, false };
2363
yield return new object[] { true, userEdit, source, new KeyEventArgs(
Keys
.Left), 0, 0, 0, false };
2364
yield return new object[] { false, userEdit, source, new KeyEventArgs(
Keys
.Left), 0, 0, 0, false };
2365
yield return new object[] { true, userEdit, source, new KeyEventArgs(
Keys
.Right), 0, 0, 0, false };
2366
yield return new object[] { false, userEdit, source, new KeyEventArgs(
Keys
.Right), 0, 0, 0, false };
2371
yield return new object[] { interceptArrowKeys, true, source, new KeyEventArgs(
Keys
.Return), 0, 0, 1, false };
2372
yield return new object[] { interceptArrowKeys, false, source, new KeyEventArgs(
Keys
.Return), 0, 0, 0, false };
TextBoxBaseTests.cs (189)
5185
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Tab, multiline && acceptsTab };
5186
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Tab |
Keys
.Control, false };
5187
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Tab |
Keys
.Alt, false };
5188
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Escape, false };
5189
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Escape |
Keys
.Alt, false };
5190
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Back |
Keys
.Alt, false };
5191
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.PageUp, true };
5192
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.PageUp |
Keys
.Alt, false };
5193
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.PageDown, true };
5194
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.PageDown |
Keys
.Alt, false };
5195
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Home, true };
5196
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.Home |
Keys
.Alt, false };
5197
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.End, true };
5198
yield return new object[] { multiline, acceptsTab, readOnly,
Keys
.End |
Keys
.Alt, false };
5206
[InlineData(true, true, true,
Keys
.A, false)]
5207
[InlineData(true, true, true,
Keys
.Back, false)]
5208
[InlineData(true, true, false,
Keys
.Back, true)]
5209
[InlineData(true, true, true,
Keys
.Left, false)]
5210
[InlineData(true, true, false,
Keys
.Left, false)]
5211
[InlineData(true, true, true,
Keys
.Right, false)]
5212
[InlineData(true, true, false,
Keys
.Right, false)]
5213
[InlineData(true, true, true,
Keys
.Up, false)]
5214
[InlineData(true, true, false,
Keys
.Up, false)]
5215
[InlineData(false, true, true,
Keys
.Up, false)]
5216
[InlineData(false, true, false,
Keys
.Up, false)]
5217
[InlineData(true, true, true,
Keys
.Down, false)]
5218
[InlineData(true, true, false,
Keys
.Down, false)]
5219
[InlineData(false, true, true,
Keys
.Down, false)]
5220
[InlineData(false, true, false,
Keys
.Down, false)]
5221
[InlineData(false, true, true,
Keys
.Down |
Keys
.Alt, false)]
5222
[InlineData(false, true, false,
Keys
.Down |
Keys
.Alt, false)]
5223
public void TextBoxBase_IsInputKey_Invoke_ReturnsExpected(bool multiline, bool acceptsTab, bool readOnly,
Keys
keyData, bool expected)
5237
[InlineData(true, true, true,
Keys
.A, true)]
5238
[InlineData(true, true, true,
Keys
.Back, true)]
5239
[InlineData(true, true, false,
Keys
.Back, true)]
5240
[InlineData(true, true, true,
Keys
.Left, true)]
5241
[InlineData(true, true, false,
Keys
.Left, true)]
5242
[InlineData(true, true, true,
Keys
.Right, true)]
5243
[InlineData(true, true, false,
Keys
.Right, true)]
5244
[InlineData(true, true, true,
Keys
.Up, true)]
5245
[InlineData(true, true, false,
Keys
.Up, true)]
5246
[InlineData(false, true, true,
Keys
.Up, true)]
5247
[InlineData(false, true, false,
Keys
.Up, true)]
5248
[InlineData(true, true, true,
Keys
.Down, true)]
5249
[InlineData(true, true, false,
Keys
.Down, true)]
5250
[InlineData(false, true, true,
Keys
.Down, true)]
5251
[InlineData(false, true, false,
Keys
.Down, true)]
5252
[InlineData(false, true, true,
Keys
.Down |
Keys
.Alt, false)]
5253
[InlineData(false, true, false,
Keys
.Down |
Keys
.Alt, false)]
5254
public void TextBoxBase_IsInputKey_InvokeWithHandle_ReturnsExpected(bool multiline, bool acceptsTab, bool readOnly,
Keys
keyData, bool expected)
5808
yield return new object[] { shortcutsEnabled, readOnly,
Keys
.None, false };
5809
yield return new object[] { shortcutsEnabled, readOnly,
Keys
.A, false };
5811
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlZ, !shortcutsEnabled };
5812
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlC, !shortcutsEnabled };
5813
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlX, !shortcutsEnabled };
5814
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlV, !shortcutsEnabled };
5815
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlA, true };
5816
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlL, !shortcutsEnabled || readOnly };
5817
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlR, !shortcutsEnabled || readOnly };
5818
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlE, !shortcutsEnabled || readOnly };
5819
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlY, !shortcutsEnabled };
5820
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlDel, !shortcutsEnabled };
5821
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.ShiftDel, !shortcutsEnabled };
5822
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.ShiftIns, !shortcutsEnabled };
5823
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlJ, !shortcutsEnabled || readOnly };
5825
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlZ |
Keys
.Shift, !shortcutsEnabled };
5826
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlC |
Keys
.Shift, !shortcutsEnabled };
5827
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlX |
Keys
.Shift, !shortcutsEnabled };
5828
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlV |
Keys
.Shift, !shortcutsEnabled };
5829
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlA |
Keys
.Shift, !shortcutsEnabled };
5830
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlL |
Keys
.Shift, !shortcutsEnabled };
5831
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlR |
Keys
.Shift, !shortcutsEnabled };
5832
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlE |
Keys
.Shift, !shortcutsEnabled };
5833
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlY |
Keys
.Shift, !shortcutsEnabled };
5834
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlDel |
Keys
.Shift, !shortcutsEnabled };
5835
yield return new object[] { shortcutsEnabled, readOnly, (
Keys
)Shortcut.CtrlJ |
Keys
.Shift, !shortcutsEnabled };
5837
yield return new object[] { shortcutsEnabled, readOnly,
Keys
.Control |
Keys
.Back, !shortcutsEnabled || !readOnly };
5838
yield return new object[] { shortcutsEnabled, readOnly,
Keys
.Control |
Keys
.Shift |
Keys
.Back, !shortcutsEnabled || !readOnly };
5845
public void TextBoxBase_ProcessCmdKey_Invoke_ReturnsExpected(bool shortcutsEnabled, bool readOnly,
Keys
keyData, bool expected)
5859
public void TextBoxBase_ProcessCmdKey_InvokeWithParent_ReturnsFalse(bool shortcutsEnabled, bool readOnly,
Keys
keyData, bool expected)
5874
[InlineData(
Keys
.A)]
5875
public void TextBoxBase_ProcessCmdKey_InvokeWithoutParent_ReturnsFalse(
Keys
keyData)
5884
[InlineData(true, false, (
Keys
)Shortcut.CtrlA, true, true)]
5885
[InlineData(true, false, (
Keys
)Shortcut.CtrlA, false, true)]
5886
[InlineData(false, false, (
Keys
)Shortcut.CtrlA, true, true)]
5887
[InlineData(false, false, (
Keys
)Shortcut.CtrlA, false, true)]
5888
[InlineData(true, true, (
Keys
)Shortcut.CtrlL, true, true)]
5889
[InlineData(true, true, (
Keys
)Shortcut.CtrlL, false, true)]
5890
[InlineData(true, false, (
Keys
)Shortcut.CtrlL, true, true)]
5891
[InlineData(true, false, (
Keys
)Shortcut.CtrlL, false, false)]
5892
[InlineData(true, false,
Keys
.A, true, true)]
5893
[InlineData(true, false,
Keys
.A, false, false)]
5894
public void TextBoxBase_ProcessCmdKey_InvokeWithCustomParent_ReturnsExpected(bool shortcutsEnabled, bool readOnly,
Keys
keyData, bool result, bool expected)
5906
bool action(Message actualMsg,
Keys
actualKeyData)
5927
public Func<Message,
Keys
, bool> ProcessCmdKeyAction { get; set; }
5929
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData) => ProcessCmdKeyAction(msg, keyData);
5931
public Func<
Keys
, bool> ProcessDialogKeyAction { get; set; }
5933
protected override bool ProcessDialogKey(
Keys
keyData) => ProcessDialogKeyAction(keyData);
5942
Assert.True(control.ProcessCmdKey(ref message,
Keys
.Control |
Keys
.Back));
5956
Assert.False(control.ProcessCmdKey(ref message,
Keys
.Control |
Keys
.Back));
5971
Assert.True(control.ProcessCmdKey(ref message,
Keys
.Control |
Keys
.Back));
5989
Assert.True(control.ProcessCmdKey(ref message,
Keys
.Control |
Keys
.Back));
6006
Assert.True(control.ProcessCmdKey(ref message,
Keys
.Control |
Keys
.Back));
6011
[InlineData(true,
Keys
.A)]
6012
[InlineData(false,
Keys
.A)]
6013
[InlineData(true,
Keys
.Tab)]
6014
[InlineData(false,
Keys
.Tab)]
6015
[InlineData(true,
Keys
.Control |
Keys
.Tab)]
6016
[InlineData(false,
Keys
.Control |
Keys
.Tab)]
6017
[InlineData(true,
Keys
.Control |
Keys
.A)]
6018
[InlineData(false,
Keys
.Control |
Keys
.A)]
6019
public void TextBox_ProcessDialogKey_InvokeWithoutParent_ReturnsFalse(bool acceptsTab,
Keys
keyData)
6030
[InlineData(true,
Keys
.A)]
6031
[InlineData(false,
Keys
.A)]
6032
[InlineData(true,
Keys
.Tab)]
6033
[InlineData(false,
Keys
.Tab)]
6034
[InlineData(true,
Keys
.Control |
Keys
.Tab)]
6035
[InlineData(false,
Keys
.Control |
Keys
.Tab)]
6036
[InlineData(true,
Keys
.Control |
Keys
.A)]
6037
[InlineData(false,
Keys
.Control |
Keys
.A)]
6038
public void TextBox_ProcessDialogKey_InvokeWithParent_ReturnsFalse(bool acceptsTab,
Keys
keyData)
6051
[InlineData(true,
Keys
.A,
Keys
.A, true)]
6052
[InlineData(false,
Keys
.A,
Keys
.A, false)]
6053
[InlineData(true,
Keys
.Tab,
Keys
.Tab, true)]
6054
[InlineData(false,
Keys
.Tab,
Keys
.Tab, false)]
6055
[InlineData(true,
Keys
.Control |
Keys
.Tab,
Keys
.Tab, true)]
6056
[InlineData(false,
Keys
.Control |
Keys
.Tab,
Keys
.Control |
Keys
.Tab, false)]
6057
[InlineData(true,
Keys
.Control |
Keys
.A,
Keys
.Control |
Keys
.A, true)]
6058
[InlineData(false,
Keys
.Control |
Keys
.A,
Keys
.Control |
Keys
.A, false)]
6059
public void TextBox_ProcessDialogKey_InvokeWithCustomParent_ReturnsExpected(bool acceptsTab,
Keys
keyData,
Keys
expectedKeyData, bool result)
6062
bool action(
Keys
actualKeyData)
7743
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
7775
public new bool ProcessCmdKey(ref Message m,
Keys
keyData) => base.ProcessCmdKey(ref m, keyData);
7777
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
TrackBarTests.cs (10)
2309
[InlineData(
Keys
.Alt, false)]
2310
[InlineData(
Keys
.Alt |
Keys
.PageUp, false)]
2311
[InlineData(
Keys
.PageUp, true)]
2312
[InlineData(
Keys
.PageDown, true)]
2313
[InlineData(
Keys
.Home, true)]
2314
[InlineData(
Keys
.End, true)]
2315
[InlineData(
Keys
.A, false)]
2316
public void TrackBar_IsInputKey_Invoke_ReturnsExpected(
Keys
keyData, bool expected)
3338
public new bool IsInputKey(
Keys
keyData) => base.IsInputKey(keyData);
WebBrowserBaseTests.cs (13)
800
[InlineData(
Keys
.A)]
801
public void WebBrowserBase_ProcessDialogKey_InvokeWithoutParent_ReturnsFalse(
Keys
keyData)
809
[InlineData(
Keys
.A)]
810
public void WebBrowserBase_ProcessDialogKey_InvokeWithParent_ReturnsFalse(
Keys
keyData)
825
[InlineData(
Keys
.A, true)]
826
[InlineData(
Keys
.A, false)]
827
public void WebBrowserBase_ProcessDialogKey_InvokeWithCustomParent_ReturnsExpected(
Keys
keyData, bool result)
830
bool action(
Keys
actualKeyData)
861
public Func<Message,
Keys
, bool> ProcessCmdKeyAction { get; set; }
863
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData) => ProcessCmdKeyAction(msg, keyData);
869
public Func<
Keys
, bool> ProcessDialogKeyAction { get; set; }
871
protected override bool ProcessDialogKey(
Keys
keyData) => ProcessDialogKeyAction(keyData);
950
public new bool ProcessDialogKey(
Keys
keyData) => base.ProcessDialogKey(keyData);
System.Windows.Forms.TestUtilities (5)
CommonTestHelperEx.cs (2)
124
new(
Keys
.None),
125
new(
Keys
.Cancel)
KeyboardSimulator.cs (3)
12
public static void KeyDown(Control control,
Keys
key)
18
public static void KeyPress(Control control,
Keys
key)
25
private static (nint keyCode, nint lParam) GetKeyParameters(
Keys
key)
System.Windows.Forms.UI.IntegrationTests (3)
MenuStripTests.cs (3)
27
toolStripMenuItem1.ProcessCmdKey(ref message, keyData:
Keys
.Enter);
29
toolStripMenuItem2.ProcessCmdKey(ref message, keyData:
Keys
.Space);
32
toolStripMenuItem3.ProcessCmdKey(ref message, keyData:
Keys
.Enter);
WindowsFormsIntegration (32)
System\Windows\Integration\Convert.cs (11)
189
internal static SWI.ModifierKeys ToSystemWindowsInputModifierKeys(SWF.
Keys
keyData)
193
if ((keyData & SWF.
Keys
.Alt) == SWF.
Keys
.Alt)
195
if ((keyData & SWF.
Keys
.Control) == SWF.
Keys
.Control)
197
if ((keyData & SWF.
Keys
.Shift) == SWF.
Keys
.Shift)
199
if (((keyData & SWF.
Keys
.LWin) == SWF.
Keys
.LWin) ||
200
((keyData & SWF.
Keys
.RWin) == SWF.
Keys
.RWin))
System\Windows\Integration\ElementHost.cs (3)
459
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.
Keys
keyData)
466
_hostContainerInternal.ProcessingTabKeyFromElementHost = (keyData & SWF.
Keys
.Tab) == SWF.
Keys
.Tab;
System\Windows\Integration\WindowsFormsHost.cs (18)
924
protected override bool ProcessDialogKey(
Keys
keyData)
929
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
931
Keys
keyCode = (
Keys
)keyData &
Keys
.KeyCode;
932
if (keyCode ==
Keys
.Tab || keyCode ==
Keys
.Left ||
933
keyCode ==
Keys
.Right || keyCode ==
Keys
.Up ||
934
keyCode ==
Keys
.Down)
941
if ((keyCode ==
Keys
.Left || keyCode ==
Keys
.Right || keyCode ==
Keys
.Down || keyCode ==
Keys
.Up)
945
return c.SelectNextControl(this.ActiveControl, keyCode ==
Keys
.Right || keyCode ==
Keys
.Down, false, false, false);
WinFormsControlsTest (10)
MenuStripAndCheckedListBox.Designer.cs (9)
97
this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.N)));
105
this.openToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.O)));
231
this.uncheckedCheckOnClickToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.
Keys
)((System.Windows.Forms.
Keys
.Control | System.Windows.Forms.
Keys
.C)));
RichTextBoxes.cs (1)
96
if (e.Control && e.KeyCode ==
Keys
.F)