2044 references to Keys
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 (1612)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1637
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)
2484
private protected static
Keys
LastKeyData { get; set; }
2596
public static
Keys
ModifierKeys
2600
Keys
modifiers = 0;
2602
if (PInvoke.GetKeyState((int)
Keys
.ShiftKey) < 0)
2604
modifiers |=
Keys
.Shift;
2607
if (PInvoke.GetKeyState((int)
Keys
.ControlKey) < 0)
2609
modifiers |=
Keys
.Control;
2612
if (PInvoke.GetKeyState((int)
Keys
.Menu) < 0)
2614
modifiers |=
Keys
.Alt;
2631
if (PInvoke.GetKeyState((int)
Keys
.LButton) < 0)
2636
if (PInvoke.GetKeyState((int)
Keys
.RButton) < 0)
2641
if (PInvoke.GetKeyState((int)
Keys
.MButton) < 0)
2646
if (PInvoke.GetKeyState((int)
Keys
.XButton1) < 0)
2651
if (PInvoke.GetKeyState((int)
Keys
.XButton2) < 0)
6293
public static bool IsKeyLocked(
Keys
keyVal)
6295
if (keyVal is
Keys
.Insert or
Keys
.NumLock or
Keys
.CapsLock or
Keys
.Scroll)
6306
return keyVal is
Keys
.Insert or
Keys
.CapsLock ? (result & 0x1) != 0x0 : (result & 0x8001) != 0x0;
6330
int mask = charCode == (char)(int)
Keys
.Tab
6350
protected virtual bool IsInputKey(
Keys
keyData)
6352
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
6358
switch (keyData &
Keys
.KeyCode)
6360
case
Keys
.Tab:
6363
case
Keys
.Left:
6364
case
Keys
.Right:
6365
case
Keys
.Up:
6366
case
Keys
.Down:
7743
&& (e.KeyCode.HasFlag(
Keys
.ControlKey) || e.KeyCode ==
Keys
.Escape))
8607
/// For WM_KEYDOWN and WM_SYSKEYDOWN messages, this first calls <see cref="ProcessCmdKey(ref Message,
Keys
)"/>
8609
/// <see cref="IsInputKey(
Keys
)"/> is called to check whether the key message represents an input key for the
8610
/// control. Finally, if <see cref="IsInputKey(
Keys
)"/> indicates that the control isn't interested in the key
8611
/// message, then <see cref="ProcessDialogKey(
Keys
)"/> is called to check for dialog keys such as TAB, arrow
8631
/// <see cref="IsInputKey(
Keys
)"/>, <see cref="ProcessCmdKey(ref Message,
Keys
)"/>, <see cref="ProcessDialogChar(char)"/>,
8632
/// or <see cref="ProcessDialogKey(
Keys
)"/>) instead of overriding this method.
8646
Keys
keyData = (
Keys
)(nint)msg.WParamInternal | ModifierKeys;
8714
Keys
keyData = (
Keys
)(nint)message.WParamInternal | ModifierKeys;
8778
/// If the control has a parent, the key is passed to the parent's <see cref="ProcessCmdKey(ref Message,
Keys
)"/>
8784
protected virtual bool ProcessCmdKey(ref Message msg,
Keys
keyData) =>
8899
/// arrow keys. This method is called only if the <see cref="IsInputKey(
Keys
)"/> method indicates that the control
8900
/// is not processing the key. The <see cref="ProcessDialogKey(
Keys
)"/> simply sends the character to the parent's
8901
/// <see cref="ProcessDialogKey(
Keys
)"/> method, or returns <see langword="false"/> if the control has no parent.
8905
protected virtual bool ProcessDialogKey(
Keys
keyData) => _parent?.ProcessDialogKey(keyData) ?? false;
8959
ke = new KeyEventArgs((
Keys
)(int)m.WParamInternal | ModifierKeys);
9041
Keys
keyCode = (
Keys
)(nint)msg.WParamInternal &
Keys
.KeyCode;
9043
if (keyCode is not
Keys
.F10 and not
Keys
.Menu and not
Keys
.Tab)
9067
if (keyCode is
Keys
.F10 or
Keys
.Menu)
9076
if (keyCode ==
Keys
.Tab)
12914
static bool IsKeyDown(
Keys
key, ReadOnlySpan<byte> stateArray)
12922
return IsKeyDown(
Keys
.Tab, stateArray)
12923
|| IsKeyDown(
Keys
.Up, stateArray)
12924
|| IsKeyDown(
Keys
.Down, stateArray)
12925
|| IsKeyDown(
Keys
.Left, stateArray)
12926
|| IsKeyDown(
Keys
.Right, stateArray)
12928
|| IsKeyDown(
Keys
.Menu, stateArray)
12929
|| IsKeyDown(
Keys
.F10, stateArray)
12930
|| IsKeyDown(
Keys
.Escape, stateArray);
System\Windows\Forms\Control.ExtendedStates.cs (1)
45
/// Used to flag that <see cref="IsInputKey(
Keys
)"/> returned true in <see cref="PreProcessMessage(ref Message)" />
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (3)
1178
if (kevent.KeyData ==
Keys
.Space)
1221
if (kevent.KeyCode is
Keys
.Enter or
Keys
.Space)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
388
if (PInvoke.GetKeyState((int)
Keys
.Tab) >= 0)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (33)
1447
if (keyChar == (char)(int)
Keys
.Escape)
1451
else if (keyChar == (char)(int)
Keys
.Return && DroppedDown)
2018
Debug.Assert((ModifierKeys &
Keys
.Alt) == 0);
2021
if ((
Keys
)(int)m.WParamInternal ==
Keys
.Delete)
2036
Debug.Assert((ModifierKeys &
Keys
.Alt) == 0);
2038
if (keyChar == (char)
Keys
.Back)
2060
else if (keyChar == (char)
Keys
.Escape)
2066
if (keyChar != (char)
Keys
.Escape && keyChar != (char)
Keys
.Return && !DroppedDown
2132
protected override bool IsInputKey(
Keys
keyData)
2134
Keys
keyCode = keyData & (
Keys
.KeyCode |
Keys
.Alt);
2135
if (keyCode is
Keys
.Return or
Keys
.Escape)
2434
if (e.KeyCode ==
Keys
.Return)
2439
else if ((e.KeyCode ==
Keys
.Escape) && _autoCompleteDroppedDown)
2461
if (!e.Handled && (e.KeyChar == (char)(int)
Keys
.Return || e.KeyChar == (char)(int)
Keys
.Escape)
2490
private static bool ContainsNavigationKeyCode(
Keys
keyCode) => keyCode switch
2492
Keys
.Home or
Keys
.End or
Keys
.Left or
Keys
.Right => true,
2918
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
2922
if (!returnedValue && keyData == (
Keys
.Control |
Keys
.A))
2933
&& (keyData == (
Keys
.Control |
Keys
.Back) || keyData == (
Keys
.Control |
Keys
.Shift |
Keys
.Back)))
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (335)
10062
protected override bool IsInputKey(
Keys
keyData)
10064
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
10069
switch (keyData &
Keys
.KeyCode)
10071
case
Keys
.Escape:
10076
case
Keys
.Tab:
10078
return GetTabKeyEffective((keyData &
Keys
.Shift) ==
Keys
.Shift, (keyData &
Keys
.Control) ==
Keys
.Control);
10081
case
Keys
.A:
10083
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Control)
10091
case
Keys
.C:
10092
case
Keys
.Insert:
10094
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Control)
10102
case
Keys
.Space:
10104
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift
10115
case
Keys
.Up:
10116
case
Keys
.Down:
10117
case
Keys
.Left:
10118
case
Keys
.Right:
10119
case
Keys
.Home:
10120
case
Keys
.End:
10121
case
Keys
.Next:
10122
case
Keys
.Prior:
10123
case
Keys
.Enter:
10124
case
Keys
.Delete:
10125
case
Keys
.D0:
10126
case
Keys
.NumPad0:
10127
case
Keys
.F2:
10128
case
Keys
.F3:
11892
Keys
nModifier = ModifierKeys;
11893
bool isControlDown = (nModifier &
Keys
.Control) ==
Keys
.Control && (nModifier &
Keys
.Alt) == 0;
11894
bool isShiftDown = (nModifier &
Keys
.Shift) ==
Keys
.Shift;
11895
bool isAltDown = (nModifier &
Keys
.Alt) ==
Keys
.Alt;
15694
switch (e.KeyData &
Keys
.KeyCode)
15696
case
Keys
.A:
15697
case
Keys
.C:
15698
case
Keys
.D0:
15699
case
Keys
.NumPad0:
15700
case
Keys
.Delete:
15701
case
Keys
.Down:
15702
case
Keys
.F2:
15703
case
Keys
.F3:
15704
case
Keys
.F10:
15705
case
Keys
.End:
15706
case
Keys
.Enter:
15707
case
Keys
.Escape:
15708
case
Keys
.Home:
15709
case
Keys
.Insert:
15710
case
Keys
.Left:
15711
case
Keys
.Next:
15712
case
Keys
.Prior:
15713
case
Keys
.Right:
15714
case
Keys
.Space:
15715
case
Keys
.Tab:
15716
case
Keys
.Up:
15761
if (_dataGridViewOper[OperationTrackKeyboardColResize] && (e.KeyData &
Keys
.Alt) !=
Keys
.Alt)
16457
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
16462
bool verticalScroll = ((ModifierKeys &
Keys
.Control) == 0);
19913
protected bool ProcessAKey(
Keys
keyData)
19915
if ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) ==
Keys
.Control && MultiSelect)
19924
protected bool ProcessDeleteKey(
Keys
keyData)
20051
protected override bool ProcessDialogKey(
Keys
keyData)
20053
Keys
key = (keyData &
Keys
.KeyCode);
20055
if (key ==
Keys
.Enter)
20062
else if (key ==
Keys
.Escape)
20084
else if (key is
Keys
.D0 or
Keys
.NumPad0)
20091
else if (key is
Keys
.C or
Keys
.Insert)
20098
else if (key ==
Keys
.Tab)
20125
keyData &= ~
Keys
.Control;
20142
protected bool ProcessDownKey(
Keys
keyData) => ProcessDownKeyInternal(keyData, out bool _);
20144
private bool ProcessDownKeyInternal(
Keys
keyData, out bool moved)
20171
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20173
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20296
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20424
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20426
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20538
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20660
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20662
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20808
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20968
if ((keyData &
Keys
.Control) ==
Keys
.Control)
21066
protected bool ProcessEndKey(
Keys
keyData)
21085
if ((keyData &
Keys
.Control) == 0)
21087
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21101
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21134
if ((keyData &
Keys
.Control) == 0)
21136
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21150
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21211
if ((keyData &
Keys
.Control) == 0)
21213
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21228
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21251
if ((keyData &
Keys
.Control) == 0)
21253
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21257
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21342
if ((keyData &
Keys
.Control) == 0)
21344
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21359
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21395
protected bool ProcessEnterKey(
Keys
keyData)
21402
if ((keyData &
Keys
.Control) == 0)
21406
keyData &= ~
Keys
.Shift;
21477
protected bool ProcessEscapeKey(
Keys
keyData)
21496
protected bool ProcessF2Key(
Keys
keyData)
21525
protected bool ProcessF3Key(
Keys
keyData)
21543
protected bool ProcessHomeKey(
Keys
keyData)
21559
if ((keyData &
Keys
.Control) == 0)
21561
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21575
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21608
if ((keyData &
Keys
.Control) == 0)
21610
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21624
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21685
if ((keyData &
Keys
.Control) == 0)
21687
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21702
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21730
if ((keyData &
Keys
.Control) == 0)
21732
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21736
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21821
if ((keyData &
Keys
.Control) == 0)
21823
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21853
protected bool ProcessInsertKey(
Keys
keyData)
21855
if (((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) ==
Keys
.Control
21856
|| ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) == (
Keys
.Control |
Keys
.Shift)
21857
&& (keyData &
Keys
.KeyCode) ==
Keys
.C))
21885
KeyEventArgs ke = new((
Keys
)(nint)m.WParamInternal | ModifierKeys);
21886
if (ke.KeyCode !=
Keys
.ProcessKey || m.LParamInternal != 0x01) // Changing IME context does not trigger editing mode
21901
if (BeginEditInternal(selectAll: !(ke.KeyCode ==
Keys
.F2 && ModifierKeys == 0 && EditMode == DataGridViewEditMode.EditOnKeystrokeOrF2)))
21933
KeyEventArgs ke = new((
Keys
)(nint)m.WParamInternal | ModifierKeys);
21943
Keys
.Escape or
Keys
.Space => true,
21948
Keys
.Delete
21949
or
Keys
.Down
21950
or
Keys
.End
21951
or
Keys
.Enter
21952
or
Keys
.Escape
21953
or
Keys
.F2
21954
or
Keys
.F3
21955
or
Keys
.Home
21956
or
Keys
.Left
21957
or
Keys
.Next
21958
or
Keys
.Prior
21959
or
Keys
.Right
21960
or
Keys
.Space
21961
or
Keys
.Tab
21962
or
Keys
.Up => true,
22000
private bool? ProcessColumnResize(
Keys
keyData, int step)
22002
if ((keyData &
Keys
.Alt) ==
Keys
.Alt && AllowUserToResizeColumns && _ptCurrentCell.X != -1)
22036
protected bool ProcessControlShiftF10Keys(
Keys
keyData)
22058
protected bool ProcessLeftKey(
Keys
keyData) => RightToLeftInternal
22062
private bool ProcessLeftKeyPrivate(
Keys
keyData)
22098
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22100
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22104
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22209
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22211
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22215
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22318
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22320
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22324
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22462
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22464
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22914
protected bool ProcessNextKey(
Keys
keyData)
23028
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23068
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23104
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23177
protected bool ProcessPriorKey(
Keys
keyData)
23287
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23326
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23362
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23435
protected bool ProcessRightKey(
Keys
keyData) => RightToLeftInternal
23439
private bool ProcessRightKeyPrivate(
Keys
keyData)
23477
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23479
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23483
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23587
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23589
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23593
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23696
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23698
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23702
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23842
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23844
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
24254
protected bool ProcessSpaceKey(
Keys
keyData)
24256
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift && _ptCurrentCell.X != -1)
24339
protected bool ProcessTabKey(
Keys
keyData)
24343
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24345
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24379
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24385
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24422
case
Keys
.Tab:
24427
case
Keys
.Up:
24432
case
Keys
.Down:
24437
case
Keys
.Next:
24442
case
Keys
.Prior:
24447
case
Keys
.Left:
24452
case
Keys
.Right:
24457
case
Keys
.F2:
24462
case
Keys
.F3:
24467
case
Keys
.F10:
24477
case
Keys
.Home:
24482
case
Keys
.D0:
24483
case
Keys
.NumPad0:
24488
case
Keys
.Delete:
24493
case
Keys
.End:
24498
case
Keys
.Enter:
24503
case
Keys
.Escape:
24508
case
Keys
.A:
24513
case
Keys
.C:
24514
case
Keys
.Insert:
24519
case
Keys
.Space:
24528
protected bool ProcessUpKey(
Keys
keyData)
24551
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24553
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24645
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24749
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24751
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24836
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24933
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24935
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
25054
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
25186
if ((keyData &
Keys
.Control) ==
Keys
.Control)
25266
protected bool ProcessZeroKey(
Keys
keyData)
25286
if ((keyData & (
Keys
.Alt |
Keys
.Shift |
Keys
.Control)) ==
Keys
.Control && IsCurrentCellInEditMode)
30017
Keys
modifierKeys = ModifierKeys;
30018
if (GetTabKeyEffective((modifierKeys &
Keys
.Shift) ==
Keys
.Shift, (modifierKeys &
Keys
.Control) ==
Keys
.Control))
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (4)
437
e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift;
440
e.KeyCode ==
Keys
.Space;
461
if (e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift)
475
if (e.KeyCode ==
Keys
.Space)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (3)
1371
sb.Append((char)
Keys
.Return);
1372
sb.Append((char)
Keys
.LineFeed);
1377
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)
1509
if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >=
Keys
.F1 && e.KeyCode <=
Keys
.F24)) ||
1510
(e.KeyCode >=
Keys
.NumPad0 && e.KeyCode <=
Keys
.Divide) ||
1511
(e.KeyCode >=
Keys
.OemSemicolon && e.KeyCode <=
Keys
.Oem102) ||
1512
(e.KeyCode ==
Keys
.Space && !e.Shift) ||
1513
(e.KeyCode ==
Keys
.F4) ||
1514
((e.KeyCode ==
Keys
.Down || e.KeyCode ==
Keys
.Up) && e.Alt)) &&
1515
(!e.Alt || (e.KeyCode ==
Keys
.Down || e.KeyCode ==
Keys
.Up)) &&
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.cs (7)
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)
682
if (e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift)
728
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)
531
if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >=
Keys
.F1 && e.KeyCode <=
Keys
.F24)) ||
532
(e.KeyCode >=
Keys
.NumPad0 && e.KeyCode <=
Keys
.Divide) ||
533
(e.KeyCode >=
Keys
.OemSemicolon && e.KeyCode <=
Keys
.Oem102) ||
534
(e.KeyCode ==
Keys
.Space && !e.Shift)) &&
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (23)
122
public virtual bool EditingControlWantsInputKey(
Keys
keyData, bool dataGridViewWantsInputKey)
124
switch (keyData &
Keys
.KeyCode)
126
case
Keys
.Right:
137
case
Keys
.Left:
149
case
Keys
.Down:
160
case
Keys
.Up:
171
case
Keys
.Home:
172
case
Keys
.End:
180
case
Keys
.Prior:
181
case
Keys
.Next:
189
case
Keys
.Delete:
198
case
Keys
.Enter:
199
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift && Multiline && AcceptsReturn)
251
switch ((
Keys
)(nint)m.WParamInternal)
253
case
Keys
.Enter:
255
&& !(ModifierKeys ==
Keys
.Shift && Multiline && AcceptsReturn))
265
case
Keys
.LineFeed:
266
if (m.MsgInternal == PInvokeCore.WM_CHAR && ModifierKeys ==
Keys
.Control && Multiline && AcceptsReturn)
274
case
Keys
.A:
275
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)
1028
protected override bool IsInputKey(
Keys
keyData)
1030
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
1035
return (keyData &
Keys
.KeyCode) switch
1037
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)
798
if (e.KeyCode ==
Keys
.Enter)
1404
protected override bool ProcessDialogKey(
Keys
keyData)
1406
if ((keyData & (
Keys
.Alt |
Keys
.Control)) !=
Keys
.Alt)
1408
Keys
keyCode = keyData &
Keys
.KeyCode;
1411
case
Keys
.Tab:
1414
bool forward = (keyData &
Keys
.Shift) !=
Keys
.Shift;
1422
case
Keys
.Up:
1423
case
Keys
.Left:
1430
case
Keys
.Down:
1431
case
Keys
.Right:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (10)
918
Keys
keycode = (
Keys
)m.WParamInternal.LOWORD;
921
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)
576
protected override bool IsInputKey(
Keys
keyData)
578
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
583
return (keyData &
Keys
.KeyCode) switch
585
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
System\Windows\Forms\Controls\ListView\ListView.cs (16)
4262
protected override bool IsInputKey(
Keys
keyData)
4264
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
4269
switch (keyData &
Keys
.KeyCode)
4271
case
Keys
.PageUp:
4272
case
Keys
.PageDown:
4273
case
Keys
.Home:
4274
case
Keys
.End:
4286
switch (keyData &
Keys
.KeyCode)
4288
case
Keys
.Return:
4289
case
Keys
.Escape:
6752
if ((lvkd->wVKey == (short)
Keys
.Down || lvkd->wVKey == (short)
Keys
.Up) && SelectedItems.Count > 0)
6755
if (lvkd->wVKey == (short)
Keys
.Down
6766
if (lvkd->wVKey == (short)
Keys
.Up
6778
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)
1331
protected override bool IsInputKey(
Keys
keyData)
1333
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
1338
return (keyData &
Keys
.KeyCode) switch
1340
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (6)
3213
protected override bool ProcessDialogKey(
Keys
keyData)
3215
if ((keyData &
Keys
.KeyCode) !=
Keys
.Tab
3216
|| keyData.HasFlag(
Keys
.Control)
3217
|| keyData.HasFlag(
Keys
.Alt))
3223
if (keyData.HasFlag(
Keys
.Shift))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (77)
1520
if (_dropDownHolder?.Visible == true && m.MsgInternal == PInvokeCore.WM_KEYDOWN && (
Keys
)(nint)m.WParamInternal !=
Keys
.Tab)
1569
Keys
modifiers = ModifierKeys;
1570
if ((modifiers & ~
Keys
.Shift) != 0)
1586
case unchecked((char)(int)(long)
Keys
.Tab):
2045
protected override bool IsInputKey(
Keys
keyData)
2047
switch (keyData &
Keys
.KeyCode)
2049
case
Keys
.Escape:
2050
case
Keys
.Tab:
2051
case
Keys
.F4:
2054
case
Keys
.Return:
2345
if (e.KeyCode ==
Keys
.Return)
2453
private bool ProcessEnumUpAndDown(GridEntry entry,
Keys
keyCode, bool closeDropDown = true)
2481
if (keyCode ==
Keys
.Up)
2511
if (!e.Alt && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down))
2526
else if ((e.KeyCode ==
Keys
.Left || e.KeyCode ==
Keys
.Right)
2527
&& (e.Modifiers & ~
Keys
.Shift) != 0)
2650
if ((ModifierKeys & (
Keys
.Alt |
Keys
.Control)) != 0)
2732
Keys
keyCode = e.KeyCode;
2737
if (keyCode ==
Keys
.Tab)
2747
if (keyCode ==
Keys
.Down && altPressed && DropDownButton.Visible)
2753
if (keyCode ==
Keys
.Up && altPressed && DropDownButton.Visible && (_dropDownHolder is not null) && _dropDownHolder.Visible)
2768
case
Keys
.Up:
2769
case
Keys
.Down:
2770
int position = keyCode ==
Keys
.Up ? _selectedRow - 1 : _selectedRow + 1;
2774
case
Keys
.Left:
2793
case
Keys
.Right:
2819
case
Keys
.Return:
2830
case
Keys
.Home:
2831
case
Keys
.End:
2833
SelectGridEntry(allEntries[keyCode ==
Keys
.Home ? 0 : allEntries.Count - 1], pageIn: true);
2835
case
Keys
.Add:
2836
case
Keys
.Oemplus:
2837
case
Keys
.OemMinus:
2838
case
Keys
.Subtract:
2846
bool expand = keyCode is
Keys
.Add or
Keys
.Oemplus;
2852
case
Keys
.D8:
2855
goto case
Keys
.Multiply;
2859
case
Keys
.Multiply:
2865
case
Keys
.Prior: // PAGE_UP
2866
case
Keys
.Next: // PAGE_DOWN
2868
bool next = keyCode ==
Keys
.Next;
2897
case
Keys
.Insert:
2901
goto case
Keys
.V;
2904
goto case
Keys
.C;
2905
case
Keys
.C:
2914
case
Keys
.Delete:
2919
goto case
Keys
.X;
2923
case
Keys
.X:
2933
case
Keys
.V:
2941
case
Keys
.A:
2952
if (e.KeyData == (
Keys
.C |
Keys
.Alt |
Keys
.Shift |
Keys
.Control))
2962
&& (keyCode ==
Keys
.Up || keyCode ==
Keys
.Down))
3156
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
3840
protected override bool ProcessDialogKey(
Keys
keyData)
3844
Keys
keyCode = keyData &
Keys
.KeyCode;
3847
case
Keys
.F4:
3861
case
Keys
.Tab:
3863
if (((keyData &
Keys
.Control) != 0) ||
3864
((keyData &
Keys
.Alt) != 0))
3869
bool forward = (keyData &
Keys
.Shift) == 0;
3931
case
Keys
.Up:
3932
case
Keys
.Down:
3933
case
Keys
.Left:
3934
case
Keys
.Right:
3936
case
Keys
.Return:
5362
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)
2583
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (5)
87
Keys
modifierKeys = ModifierKeys;
111
if ((modifierKeys &
Keys
.Control) ==
Keys
.Control)
116
if ((modifierKeys &
Keys
.Shift) ==
Keys
.Shift)
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
803
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,
1390
if (ke.KeyCode ==
Keys
.Tab && (ke.KeyData &
Keys
.Control) != 0)
1392
bool forward = (ke.KeyData &
Keys
.Shift) == 0;
1396
if (ke.KeyCode ==
Keys
.PageDown && (ke.KeyData &
Keys
.Control) != 0)
1401
if (ke.KeyCode ==
Keys
.PageUp && (ke.KeyData &
Keys
.Control) != 0)
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (28)
532
protected override bool IsInputKey(
Keys
keyData)
534
if ((keyData &
Keys
.KeyCode) ==
Keys
.Return)
1163
Delete(
Keys
.Delete, 0, _maskedTextProvider.Length);
1497
private void Delete(
Keys
keyCode, int startPosition, int selectionLen)
1500
Debug.Assert(keyCode is
Keys
.Delete or
Keys
.Back, $"Delete called with keyCode == {keyCode}");
1510
if (keyCode ==
Keys
.Back)
1556
if (keyCode ==
Keys
.Delete)
1588
if (keyCode ==
Keys
.Back) // Case 3.
1848
Keys
keyCode = e.KeyCode;
1851
if (keyCode is
Keys
.Return or
Keys
.Escape)
1858
if (keyCode ==
Keys
.Insert && e.Modifiers ==
Keys
.None && _insertMode == InsertKeyMode.Default)
1880
case
Keys
.H: // ctrl-h == Backspace == '\b'
1881
keyCode =
Keys
.Back; // handle it below.
1893
if (keyCode is
Keys
.Delete or
Keys
.Back) // Deletion keys.
1901
case
Keys
.Shift:
1902
if (keyCode ==
Keys
.Delete)
1904
keyCode =
Keys
.Back;
1909
case
Keys
.Control:
1912
if (keyCode ==
Keys
.Delete) // delete to the end of the string.
2283
Delete(
Keys
.Delete, selStart, selLength);
2413
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
2701
Delete(
Keys
.Delete, selStart, selLength);
2823
Delete(
Keys
.Delete, startEditPos, selectionLen);
System\Windows\Forms\Controls\TextBox\TextBox.cs (7)
517
protected override bool IsInputKey(
Keys
keyData)
519
if (Multiline && (keyData &
Keys
.Alt) == 0)
521
switch (keyData &
Keys
.KeyCode)
523
case
Keys
.Return:
670
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
673
if (!returnValue && ShortcutsEnabled && (keyData == (
Keys
.Control |
Keys
.A)))
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (36)
161
(int)Shortcut.CtrlE, (int)Shortcut.CtrlY, (int)
Keys
.Control + (int)
Keys
.Back,
172
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
183
(int)keyData == (shortcutValue | (int)
Keys
.Shift))
205
if (!ReadOnly && (keyData == (
Keys
.Control |
Keys
.Back) || keyData == (
Keys
.Control |
Keys
.Shift |
Keys
.Back)))
1282
protected bool ContainsNavigationKeyCode(
Keys
keyCode) => keyCode switch
1284
Keys
.Up or
Keys
.Down or
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End or
Keys
.Left or
Keys
.Right => true,
1331
protected override bool IsInputKey(
Keys
keyData)
1333
if ((keyData &
Keys
.Alt) !=
Keys
.Alt)
1335
switch (keyData &
Keys
.KeyCode)
1337
case
Keys
.Tab:
1340
return Multiline && _textBoxFlags[s_acceptsTab] && ((keyData &
Keys
.Control) == 0);
1341
case
Keys
.Escape:
1348
case
Keys
.Back:
1355
case
Keys
.PageUp:
1356
case
Keys
.PageDown:
1357
case
Keys
.Home:
1358
case
Keys
.End:
1413
protected override bool ProcessDialogKey(
Keys
keyData)
1415
Keys
keyCode = keyData &
Keys
.KeyCode;
1417
if (keyCode ==
Keys
.Tab && AcceptsTab && (keyData &
Keys
.Control) != 0)
1420
keyData &= ~
Keys
.Control;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (39)
51
private Dictionary<
Keys
, ToolStripMenuItem>? _shortcuts;
1640
internal Dictionary<
Keys
, ToolStripMenuItem> Shortcuts
1644
_shortcuts ??= new Dictionary<
Keys
, ToolStripMenuItem>(1);
2047
bool forward = LastKeyData ==
Keys
.Tab || (TabStop && start is null && LastKeyData !=
Keys
.Left);
2545
protected override bool IsInputKey(
Keys
keyData) =>
2636
internal bool ProcessCmdKeyInternal(ref Message m,
Keys
keyData)
2669
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
2708
(keyData &
Keys
.Control) ==
Keys
.Control && (keyData &
Keys
.KeyCode) ==
Keys
.Tab;
2713
&& ToolStripManager.SelectNextToolStrip(this, forward: (keyData &
Keys
.Shift) ==
Keys
.None))
2732
protected override bool ProcessDialogKey(
Keys
keyData)
2750
bool hasModifiers = ((keyData & (
Keys
.Alt |
Keys
.Control)) !=
Keys
.None);
2752
Keys
keyCode = keyData &
Keys
.KeyCode;
2755
case
Keys
.Back:
2765
case
Keys
.Tab:
2769
retVal = ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None);
2773
case
Keys
.Left:
2774
case
Keys
.Right:
2775
case
Keys
.Up:
2776
case
Keys
.Down:
2779
case
Keys
.Home:
2783
case
Keys
.End:
2787
case
Keys
.Escape: // escape and menu key should restore focus
2842
if (!inMenuMode && ModifierKeys ==
Keys
.Alt)
3031
internal virtual bool ProcessArrowKey(
Keys
keyCode)
3038
case
Keys
.Left:
3039
case
Keys
.Right:
3040
retVal = ProcessLeftRightArrowKey(keyCode ==
Keys
.Right);
3042
case
Keys
.Up:
3043
case
Keys
.Down:
3047
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)
1284
internal override bool ProcessArrowKey(
Keys
keyCode)
1288
if (keyCode is
Keys
.Left or
Keys
.Right)
1290
bool forward = keyCode ==
Keys
.Right;
1348
protected override bool ProcessDialogKey(
Keys
keyData)
1371
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)
2060
if (Control.ModifierKeys ==
Keys
.Alt)
2408
protected internal virtual bool IsInputKey(
Keys
keyData) => false;
2474
if (PInvoke.GetKeyState((int)
Keys
.LButton) < 0)
3048
protected internal virtual bool ProcessDialogKey(
Keys
keyData)
3050
if (keyData ==
Keys
.Enter || (_state[s_stateSupportsSpaceKey] && keyData ==
Keys
.Space))
3069
protected internal virtual bool ProcessCmdKey(ref Message m,
Keys
keyData) => false;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (27)
653
public static bool IsValidShortcut(
Keys
shortcut)
656
Keys
keyCode = shortcut &
Keys
.KeyCode;
657
Keys
modifiers = shortcut &
Keys
.Modifiers;
659
if (shortcut ==
Keys
.None)
663
else if (keyCode is
Keys
.Delete or
Keys
.Insert)
667
else if ((int)keyCode is >= ((int)
Keys
.F1) and <= ((int)
Keys
.F24))
672
else if ((keyCode !=
Keys
.None) && (modifiers !=
Keys
.None))
676
case
Keys
.Menu:
677
case
Keys
.ControlKey:
678
case
Keys
.ShiftKey:
682
if (modifiers ==
Keys
.Shift)
696
internal static bool IsMenuKey(
Keys
keyData)
697
=> (keyData &
Keys
.KeyCode) is
Keys
.Menu or
Keys
.F10;
699
public static bool IsShortcutDefined(
Keys
shortcut)
716
internal static bool ProcessCmdKey(ref Message m,
Keys
keyData)
741
internal static bool ProcessShortcut(ref Message m,
Keys
shortcut)
878
Keys
keyData = (
Keys
)(nint)m.LParamInternal;
921
if (PInvoke.GetKeyState((int)
Keys
.ShiftKey) < 0 && (keyData ==
Keys
.None))
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (2)
256
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))
917
Keys
shortcut = ShortcutKeys;
918
if (shortcut !=
Keys
.None)
1032
protected internal override bool ProcessCmdKey(ref Message m,
Keys
keyData)
1089
internal static string? ShortcutToText(
Keys
shortcutKeys, string? shortcutKeyDisplayString)
1096
if (shortcutKeys ==
Keys
.None)
1103
return TypeDescriptor.GetConverter(typeof(
Keys
)).ConvertToString(context: null, CultureInfo.CurrentUICulture, shortcutKeys);
1108
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)
838
protected override bool IsInputKey(
Keys
keyData)
840
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
845
return (keyData &
Keys
.KeyCode) switch
847
Keys
.PageUp or
Keys
.PageDown or
Keys
.Home or
Keys
.End => true,
923
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
System\Windows\Forms\Controls\TreeView\TreeView.cs (13)
1802
protected override bool IsInputKey(
Keys
keyData)
1807
if (_editNode is not null && (keyData &
Keys
.Alt) == 0)
1809
switch (keyData &
Keys
.KeyCode)
1811
case
Keys
.Return:
1812
case
Keys
.Escape:
1813
case
Keys
.PageUp:
1814
case
Keys
.PageDown:
1815
case
Keys
.Home:
1816
case
Keys
.End:
2251
if (CheckBoxes && (e.KeyData &
Keys
.KeyCode) ==
Keys
.Space)
2281
if ((e.KeyData &
Keys
.KeyCode) ==
Keys
.Space)
System\Windows\Forms\Controls\Unsupported\ContextMenu\ContextMenu.cs (1)
55
protected internal virtual bool ProcessCmdKey(ref Message msg,
Keys
keyData, Control control) => throw null;
System\Windows\Forms\Controls\Unsupported\ContextMenu\Menu.cs (1)
79
protected internal virtual bool ProcessCmdKey(ref Message msg,
Keys
keyData) => throw null;
System\Windows\Forms\Controls\Unsupported\DataGrid\DataGrid.cs (1)
566
protected bool ProcessTabKey(
Keys
keyData) => throw null;
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (6)
421
if (InterceptArrowKeys && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down) && !Spinning)
434
if (InterceptArrowKeys && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down))
473
else if ((ModifierKeys & (
Keys
.Control |
Keys
.Alt)) != 0)
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (5)
596
if (e.KeyData ==
Keys
.Up)
603
else if (e.KeyData ==
Keys
.Down)
611
if (e.KeyCode ==
Keys
.Return && UserEdit)
731
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)
741
case
Keys
.Enter:
744
case
Keys
.Escape:
System\Windows\Forms\Form.cs (9)
4702
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
4732
protected override bool ProcessDialogKey(
Keys
keyData)
4734
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
4736
Keys
keyCode = keyData &
Keys
.KeyCode;
4740
case
Keys
.Return:
4753
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 (74)
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 resourceName,
Keys
value)
97
/// This dictionary maps culture to a dictionary of localized names and their corresponding <see cref="
Keys
"/> value.
99
private Dictionary<CultureInfo, Dictionary<string,
Keys
>> CultureToKeyName
159
Dictionary<string,
Keys
> keyNames = GetKeyNames(culture);
165
Keys
key = 0;
170
if (!keyNames.TryGetValue(token, out
Keys
currentKey))
174
currentKey = (
Keys
)Enum.Parse(typeof(
Keys
), token);
177
if ((currentKey &
Keys
.KeyCode) != 0)
206
return Enum.ToObject(typeof(
Keys
), finalValue);
223
if (value is not
Keys
and not int)
229
? GetTermsString((
Keys
)value)
231
? GetTermKeys((
Keys
)value)
234
Enum[] GetTermKeys(
Keys
key)
237
Keys
modifiers = key &
Keys
.Modifiers;
238
Dictionary<string,
Keys
> keyNames = GetKeyNames(culture);
241
if (key !=
Keys
.None)
247
Keys
keyValue = keyNames[keyString];
248
if (keyValue !=
Keys
.None && modifiers.HasFlag(keyValue))
257
Keys
keyOnly = key &
Keys
.KeyCode;
262
Keys
keyValue = keyNames[keyString];
282
string GetTermsString(
Keys
key)
285
Keys
modifiers = key &
Keys
.Modifiers;
286
Dictionary<string,
Keys
> keyNames = GetKeyNames(culture);
289
if (key !=
Keys
.None)
295
Keys
keyValue = keyNames[keyString];
296
if (keyValue !=
Keys
.None && modifiers.HasFlag(keyValue))
305
Keys
keyOnly = key &
Keys
.KeyCode;
310
Keys
keyValue = keyNames[keyString];
344
private Dictionary<string,
Keys
> GetKeyNames(CultureInfo? culture)
365
keys.Remove(
Keys
.None);
368
Keys
[] values = [.. keys];
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)
1185
protected override bool ProcessDialogKey(
Keys
keyData)
1188
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
1190
Keys
keyCode = keyData &
Keys
.KeyCode;
1193
case
Keys
.Tab:
1194
if (ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None))
1200
case
Keys
.Left:
1201
case
Keys
.Right:
1202
case
Keys
.Up:
1203
case
Keys
.Down:
1204
if (ProcessArrowKey(keyCode is
Keys
.Right or
Keys
.Down))
1216
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)
650
case
Keys
.Delete:
653
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)
525
protected override bool ProcessDialogKey(
Keys
keyData)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (11)
197
if (e.KeyData ==
Keys
.Enter)
301
protected internal override bool ProcessDialogKey(
Keys
keyData)
309
if (keyData is (
Keys
.Alt |
Keys
.Down) or (
Keys
.Alt |
Keys
.Up) or
Keys
.F4)
324
else if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
457
protected override bool ProcessDialogKey(
Keys
keyData)
459
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)
251
protected override bool ProcessDialogKey(
Keys
keyData)
256
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)
98
protected override bool ProcessDialogKey(
Keys
keyData)
100
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)
303
protected override bool ProcessDialogKey(
Keys
keyData)
305
if ((keyData &
Keys
.KeyCode) ==
Keys
.Return && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
311
if ((keyData &
Keys
.KeyCode) ==
Keys
.Escape && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
317
if ((keyData &
Keys
.KeyCode) ==
Keys
.Tab && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
323
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)
613
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)
294
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)
2147
_ctrlSelect = PInvoke.GetKeyState((int)
Keys
.ControlKey) != 0;
System\Windows\Forms\Design\ControlDesigner.cs (2)
1322
_ctrlSelect = (Control.ModifierKeys &
Keys
.Control) != 0;
1347
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)
1034
if ((e.Modifiers) == 0 && e.KeyCode ==
Keys
.F4)
1043
Keys
modifierKeys = ModifierKeys;
1047
if ((modifierKeys &
Keys
.Control) != 0)
System\Windows\Forms\Design\DesignBindingPicker.cs (5)
1871
protected override bool IsInputKey(
Keys
key)
1873
return (key ==
Keys
.Return) || base.IsInputKey(key);
2086
if (e.KeyData ==
Keys
.Return && SelectedNode is not null)
2095
protected override bool IsInputKey(
Keys
key)
2097
return key ==
Keys
.Return || base.IsInputKey(key);
System\Windows\Forms\Design\DesignerFrame.cs (11)
154
protected override bool ProcessDialogKey(
Keys
keyData)
188
Keys
keycode = (
Keys
)(m.WParamInternal & 0xFFFF);
191
Keys
.Up => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_VSCROLL),
192
Keys
.Down => (SCROLLBAR_COMMAND.SB_LINEDOWN, (MessageId)PInvokeCore.WM_VSCROLL),
193
Keys
.PageUp => (SCROLLBAR_COMMAND.SB_PAGEUP, (MessageId)PInvokeCore.WM_VSCROLL),
194
Keys
.PageDown => (SCROLLBAR_COMMAND.SB_PAGEDOWN, (MessageId)PInvokeCore.WM_VSCROLL),
195
Keys
.Home => (SCROLLBAR_COMMAND.SB_TOP, (MessageId)PInvokeCore.WM_VSCROLL),
196
Keys
.End => (SCROLLBAR_COMMAND.SB_BOTTOM, (MessageId)PInvokeCore.WM_VSCROLL),
197
Keys
.Left => (SCROLLBAR_COMMAND.SB_LINEUP, (MessageId)PInvokeCore.WM_HSCROLL),
198
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)
73
protected override bool ProcessDialogKey(
Keys
keyData)
75
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)
532
_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)
87
Keys
[][] menuItemShortcuts =
89
[/*File*/
Keys
.None, /*New*/
Keys
.Control |
Keys
.N, /*Open*/
Keys
.Control |
Keys
.O, /*Separator*/
Keys
.None, /*Save*/
Keys
.Control |
Keys
.S, /*SaveAs*/
Keys
.None,
Keys
.None, /*Print*/
Keys
.Control |
Keys
.P, /*PrintPreview*/
Keys
.None, /*Separator*/
Keys
.None, /*Exit*/
Keys
.None],
90
[/*Edit*/
Keys
.None, /*Undo*/
Keys
.Control |
Keys
.Z, /*Redo*/
Keys
.Control |
Keys
.Y, /*Separator*/
Keys
.None, /*Cut*/
Keys
.Control |
Keys
.X, /*Copy*/
Keys
.Control |
Keys
.C, /*Paste*/
Keys
.Control |
Keys
.V, /*Separator*/
Keys
.None, /*SelectAll*/
Keys
.None],
91
[/*Tools*/
Keys
.None, /*Customize*/
Keys
.None, /*Options*/
Keys
.None],
92
[/*Help*/
Keys
.None, /*Contents*/
Keys
.None, /*Index*/
Keys
.None, /*Search*/
Keys
.None, /*Separator*/
Keys
.None, /*About*/
Keys
.None]
156
Keys
shortcut = menuItemShortcuts[j][i];
157
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)
1278
(_localDragControl is not null && existingControl is not null && Control.ModifierKeys ==
Keys
.Control))
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
2297
: (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (5)
352
bool removeSel = (Control.ModifierKeys & (
Keys
.Control |
Keys
.Shift)) > 0;
381
bool shiftPressed = (Control.ModifierKeys &
Keys
.Shift) > 0;
447
else if (shiftPressed || (Control.ModifierKeys &
Keys
.Control) > 0)
874
e.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (2)
683
bool shiftPressed = (Control.ModifierKeys &
Keys
.Shift) > 0;
728
bool shiftPressed = (Control.ModifierKeys &
Keys
.Shift) > 0;
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
2600
e.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
2615
e.Effect = (Control.ModifierKeys ==
Keys
.Control) ? DragDropEffects.Copy : DragDropEffects.Move;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (19)
1031
case
Keys
.Up:
1036
case
Keys
.Down:
1039
case
Keys
.Escape:
1042
case
Keys
.Return:
1064
if (e.KeyCode ==
Keys
.A && (e.KeyData &
Keys
.Control) != 0)
1512
protected override bool IsInputKey(
Keys
keyData)
1514
switch (keyData &
Keys
.KeyCode)
1516
case
Keys
.Return:
1527
protected override bool ProcessDialogKey(
Keys
keyData)
1662
protected override bool ProcessDialogKey(
Keys
keyData)
1667
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
1669
Keys
keyCode = keyData &
Keys
.KeyCode;
1672
case
Keys
.Tab:
1673
retVal = ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None);
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)
454
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.
Keys
keyData)
460
_hostContainerInternal?.ProcessingTabKeyFromElementHost = (keyData & SWF.
Keys
.Tab) == SWF.
Keys
.Tab;
System\Windows\Integration\WindowsFormsHost.cs (18)
895
protected override bool ProcessDialogKey(
Keys
keyData)
900
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
902
Keys
keyCode = (
Keys
)keyData &
Keys
.KeyCode;
903
if (keyCode ==
Keys
.Tab || keyCode ==
Keys
.Left ||
904
keyCode ==
Keys
.Right || keyCode ==
Keys
.Up ||
905
keyCode ==
Keys
.Down)
912
if ((keyCode ==
Keys
.Left || keyCode ==
Keys
.Right || keyCode ==
Keys
.Down || keyCode ==
Keys
.Up)
916
return c.SelectNextControl(this.ActiveControl, keyCode ==
Keys
.Right || keyCode ==
Keys
.Down, false, false, false);