2049 references to Keys
System.Windows.Forms (1626)
System\Windows\Forms\ActiveX\AxHost.cs (1)
1637
protected override bool ProcessDialogKey(
Keys
keyData) => !_ignoreDialogKeys && base.ProcessDialogKey(keyData);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (2)
41
if (IsInputKey(
Keys
.Return))
46
if (IsInputKey(
Keys
.Escape))
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
379
target.SelectNextControl(null, ModifierKeys !=
Keys
.Shift, tabStopOnly: true, nested: true, wrap: true);
System\Windows\Forms\Components\KioskModeManager\KioskModeManager.cs (14)
86
private
Keys
_toggleFullScreenKeys =
Keys
.F11;
229
/// A <see cref="
Keys
"/> value that combines a key code with the modifiers that
230
/// must be pressed with it, or <see cref="
Keys
.None"/> to disable key-based
231
/// toggling. The default is <see cref="
Keys
.F11"/>.
243
[DefaultValue(
Keys
.F11)]
244
public
Keys
ToggleFullScreenKeys
810
private void ProcessKeyboardActivity(
Keys
keyData, bool isRepeat)
818
if (_toggleFullScreenKeys !=
Keys
.None && keyData == _toggleFullScreenKeys)
822
else if (keyData ==
Keys
.Escape && _escapeExitsFullScreen && _isFullScreen)
947
Keys
keyData = ((
Keys
)(nint)message.WParamInternal &
Keys
.KeyCode)
948
| (Control.ModifierKeys &
Keys
.Modifiers);
System\Windows\Forms\Control.cs (69)
2672
private protected static
Keys
LastKeyData { get; set; }
2784
public static
Keys
ModifierKeys
2788
Keys
modifiers = 0;
2790
if (PInvoke.GetKeyState((int)
Keys
.ShiftKey) < 0)
2792
modifiers |=
Keys
.Shift;
2795
if (PInvoke.GetKeyState((int)
Keys
.ControlKey) < 0)
2797
modifiers |=
Keys
.Control;
2800
if (PInvoke.GetKeyState((int)
Keys
.Menu) < 0)
2802
modifiers |=
Keys
.Alt;
2819
if (PInvoke.GetKeyState((int)
Keys
.LButton) < 0)
2824
if (PInvoke.GetKeyState((int)
Keys
.RButton) < 0)
2829
if (PInvoke.GetKeyState((int)
Keys
.MButton) < 0)
2834
if (PInvoke.GetKeyState((int)
Keys
.XButton1) < 0)
2839
if (PInvoke.GetKeyState((int)
Keys
.XButton2) < 0)
6526
public static bool IsKeyLocked(
Keys
keyVal)
6528
if (keyVal is
Keys
.Insert or
Keys
.NumLock or
Keys
.CapsLock or
Keys
.Scroll)
6539
return keyVal is
Keys
.Insert or
Keys
.CapsLock ? (result & 0x1) != 0x0 : (result & 0x8001) != 0x0;
6563
int mask = charCode == (char)(int)
Keys
.Tab
6583
protected virtual bool IsInputKey(
Keys
keyData)
6585
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
6591
switch (keyData &
Keys
.KeyCode)
6593
case
Keys
.Tab:
6596
case
Keys
.Left:
6597
case
Keys
.Right:
6598
case
Keys
.Up:
6599
case
Keys
.Down:
8409
&& (e.KeyCode.HasFlag(
Keys
.ControlKey) || e.KeyCode ==
Keys
.Escape))
9394
/// For WM_KEYDOWN and WM_SYSKEYDOWN messages, this first calls <see cref="ProcessCmdKey(ref Message,
Keys
)"/>
9396
/// <see cref="IsInputKey(
Keys
)"/> is called to check whether the key message represents an input key for the
9397
/// control. Finally, if <see cref="IsInputKey(
Keys
)"/> indicates that the control isn't interested in the key
9398
/// message, then <see cref="ProcessDialogKey(
Keys
)"/> is called to check for dialog keys such as TAB, arrow
9418
/// <see cref="IsInputKey(
Keys
)"/>, <see cref="ProcessCmdKey(ref Message,
Keys
)"/>, <see cref="ProcessDialogChar(char)"/>,
9419
/// or <see cref="ProcessDialogKey(
Keys
)"/>) instead of overriding this method.
9433
Keys
keyData = (
Keys
)(nint)msg.WParamInternal | ModifierKeys;
9501
Keys
keyData = (
Keys
)(nint)message.WParamInternal | ModifierKeys;
9565
/// If the control has a parent, the key is passed to the parent's <see cref="ProcessCmdKey(ref Message,
Keys
)"/>
9571
protected virtual bool ProcessCmdKey(ref Message msg,
Keys
keyData) =>
9686
/// arrow keys. This method is called only if the <see cref="IsInputKey(
Keys
)"/> method indicates that the control
9687
/// is not processing the key. The <see cref="ProcessDialogKey(
Keys
)"/> simply sends the character to the parent's
9688
/// <see cref="ProcessDialogKey(
Keys
)"/> method, or returns <see langword="false"/> if the control has no parent.
9692
protected virtual bool ProcessDialogKey(
Keys
keyData) => _parent?.ProcessDialogKey(keyData) ?? false;
9746
ke = new KeyEventArgs((
Keys
)(int)m.WParamInternal | ModifierKeys);
9828
Keys
keyCode = (
Keys
)(nint)msg.WParamInternal &
Keys
.KeyCode;
9830
if (keyCode is not
Keys
.F10 and not
Keys
.Menu and not
Keys
.Tab)
9854
if (keyCode is
Keys
.F10 or
Keys
.Menu)
9863
if (keyCode ==
Keys
.Tab)
13709
static bool IsKeyDown(
Keys
key, ReadOnlySpan<byte> stateArray)
13717
return IsKeyDown(
Keys
.Tab, stateArray)
13718
|| IsKeyDown(
Keys
.Up, stateArray)
13719
|| IsKeyDown(
Keys
.Down, stateArray)
13720
|| IsKeyDown(
Keys
.Left, stateArray)
13721
|| IsKeyDown(
Keys
.Right, stateArray)
13723
|| IsKeyDown(
Keys
.Menu, stateArray)
13724
|| IsKeyDown(
Keys
.F10, stateArray)
13725
|| 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)
1163
if (kevent.KeyData ==
Keys
.Space)
1206
if (kevent.KeyCode is
Keys
.Enter or
Keys
.Space)
System\Windows\Forms\Controls\Buttons\RadioButton.cs (1)
478
if (PInvoke.GetKeyState((int)
Keys
.Tab) >= 0)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (33)
1536
if (keyChar == (char)(int)
Keys
.Escape)
1540
else if (keyChar == (char)(int)
Keys
.Return && DroppedDown)
2106
Debug.Assert((ModifierKeys &
Keys
.Alt) == 0);
2109
if ((
Keys
)(int)m.WParamInternal ==
Keys
.Delete)
2124
Debug.Assert((ModifierKeys &
Keys
.Alt) == 0);
2126
if (keyChar == (char)
Keys
.Back)
2148
else if (keyChar == (char)
Keys
.Escape)
2154
if (keyChar != (char)
Keys
.Escape && keyChar != (char)
Keys
.Return && !DroppedDown
2220
protected override bool IsInputKey(
Keys
keyData)
2222
Keys
keyCode = keyData & (
Keys
.KeyCode |
Keys
.Alt);
2223
if (keyCode is
Keys
.Return or
Keys
.Escape)
2557
if (e.KeyCode ==
Keys
.Return)
2562
else if ((e.KeyCode ==
Keys
.Escape) && _autoCompleteDroppedDown)
2584
if (!e.Handled && (e.KeyChar == (char)(int)
Keys
.Return || e.KeyChar == (char)(int)
Keys
.Escape)
2613
private static bool ContainsNavigationKeyCode(
Keys
keyCode) => keyCode switch
2615
Keys
.Home or
Keys
.End or
Keys
.Left or
Keys
.Right => true,
3049
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
3053
if (!returnedValue && keyData == (
Keys
.Control |
Keys
.A))
3064
&& (keyData == (
Keys
.Control |
Keys
.Back) || keyData == (
Keys
.Control |
Keys
.Shift |
Keys
.Back)))
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (335)
10121
protected override bool IsInputKey(
Keys
keyData)
10123
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
10128
switch (keyData &
Keys
.KeyCode)
10130
case
Keys
.Escape:
10135
case
Keys
.Tab:
10137
return GetTabKeyEffective((keyData &
Keys
.Shift) ==
Keys
.Shift, (keyData &
Keys
.Control) ==
Keys
.Control);
10140
case
Keys
.A:
10142
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Control)
10150
case
Keys
.C:
10151
case
Keys
.Insert:
10153
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Control)
10161
case
Keys
.Space:
10163
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift
10174
case
Keys
.Up:
10175
case
Keys
.Down:
10176
case
Keys
.Left:
10177
case
Keys
.Right:
10178
case
Keys
.Home:
10179
case
Keys
.End:
10180
case
Keys
.Next:
10181
case
Keys
.Prior:
10182
case
Keys
.Enter:
10183
case
Keys
.Delete:
10184
case
Keys
.D0:
10185
case
Keys
.NumPad0:
10186
case
Keys
.F2:
10187
case
Keys
.F3:
11951
Keys
nModifier = ModifierKeys;
11952
bool isControlDown = (nModifier &
Keys
.Control) ==
Keys
.Control && (nModifier &
Keys
.Alt) == 0;
11953
bool isShiftDown = (nModifier &
Keys
.Shift) ==
Keys
.Shift;
11954
bool isAltDown = (nModifier &
Keys
.Alt) ==
Keys
.Alt;
15759
switch (e.KeyData &
Keys
.KeyCode)
15761
case
Keys
.A:
15762
case
Keys
.C:
15763
case
Keys
.D0:
15764
case
Keys
.NumPad0:
15765
case
Keys
.Delete:
15766
case
Keys
.Down:
15767
case
Keys
.F2:
15768
case
Keys
.F3:
15769
case
Keys
.F10:
15770
case
Keys
.End:
15771
case
Keys
.Enter:
15772
case
Keys
.Escape:
15773
case
Keys
.Home:
15774
case
Keys
.Insert:
15775
case
Keys
.Left:
15776
case
Keys
.Next:
15777
case
Keys
.Prior:
15778
case
Keys
.Right:
15779
case
Keys
.Space:
15780
case
Keys
.Tab:
15781
case
Keys
.Up:
15826
if (_dataGridViewOper[OperationTrackKeyboardColResize] && (e.KeyData &
Keys
.Alt) !=
Keys
.Alt)
16522
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
16527
bool verticalScroll = ((ModifierKeys &
Keys
.Control) == 0);
19978
protected bool ProcessAKey(
Keys
keyData)
19980
if ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) ==
Keys
.Control && MultiSelect)
19989
protected bool ProcessDeleteKey(
Keys
keyData)
20116
protected override bool ProcessDialogKey(
Keys
keyData)
20118
Keys
key = (keyData &
Keys
.KeyCode);
20120
if (key ==
Keys
.Enter)
20127
else if (key ==
Keys
.Escape)
20149
else if (key is
Keys
.D0 or
Keys
.NumPad0)
20156
else if (key is
Keys
.C or
Keys
.Insert)
20163
else if (key ==
Keys
.Tab)
20190
keyData &= ~
Keys
.Control;
20207
protected bool ProcessDownKey(
Keys
keyData) => ProcessDownKeyInternal(keyData, out bool _);
20209
private bool ProcessDownKeyInternal(
Keys
keyData, out bool moved)
20236
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20238
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20361
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20489
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20491
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20603
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20725
if ((keyData &
Keys
.Control) ==
Keys
.Control)
20727
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
20873
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21033
if ((keyData &
Keys
.Control) ==
Keys
.Control)
21131
protected bool ProcessEndKey(
Keys
keyData)
21150
if ((keyData &
Keys
.Control) == 0)
21152
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21166
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21199
if ((keyData &
Keys
.Control) == 0)
21201
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21215
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21276
if ((keyData &
Keys
.Control) == 0)
21278
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21293
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21316
if ((keyData &
Keys
.Control) == 0)
21318
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21322
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21407
if ((keyData &
Keys
.Control) == 0)
21409
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
21424
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21460
protected bool ProcessEnterKey(
Keys
keyData)
21467
if ((keyData &
Keys
.Control) == 0)
21471
keyData &= ~
Keys
.Shift;
21542
protected bool ProcessEscapeKey(
Keys
keyData)
21561
protected bool ProcessF2Key(
Keys
keyData)
21590
protected bool ProcessF3Key(
Keys
keyData)
21608
protected bool ProcessHomeKey(
Keys
keyData)
21624
if ((keyData &
Keys
.Control) == 0)
21626
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21640
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21673
if ((keyData &
Keys
.Control) == 0)
21675
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21689
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21750
if ((keyData &
Keys
.Control) == 0)
21752
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21767
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21795
if ((keyData &
Keys
.Control) == 0)
21797
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21801
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
21886
if ((keyData &
Keys
.Control) == 0)
21888
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
21918
protected bool ProcessInsertKey(
Keys
keyData)
21920
if (((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) ==
Keys
.Control
21921
|| ((keyData & (
Keys
.Shift |
Keys
.Control |
Keys
.Alt)) == (
Keys
.Control |
Keys
.Shift)
21922
&& (keyData &
Keys
.KeyCode) ==
Keys
.C))
21950
KeyEventArgs ke = new((
Keys
)(nint)m.WParamInternal | ModifierKeys);
21951
if (ke.KeyCode !=
Keys
.ProcessKey || m.LParamInternal != 0x01) // Changing IME context does not trigger editing mode
21966
if (BeginEditInternal(selectAll: !(ke.KeyCode ==
Keys
.F2 && ModifierKeys == 0 && EditMode == DataGridViewEditMode.EditOnKeystrokeOrF2)))
22006
KeyEventArgs ke = new((
Keys
)(nint)m.WParamInternal | ModifierKeys);
22016
Keys
.Escape or
Keys
.Space => true,
22021
Keys
.Delete
22022
or
Keys
.Down
22023
or
Keys
.End
22024
or
Keys
.Enter
22025
or
Keys
.Escape
22026
or
Keys
.F2
22027
or
Keys
.F3
22028
or
Keys
.Home
22029
or
Keys
.Left
22030
or
Keys
.Next
22031
or
Keys
.Prior
22032
or
Keys
.Right
22033
or
Keys
.Space
22034
or
Keys
.Tab
22035
or
Keys
.Up => true,
22073
private bool? ProcessColumnResize(
Keys
keyData, int step)
22075
if ((keyData &
Keys
.Alt) ==
Keys
.Alt && AllowUserToResizeColumns && _ptCurrentCell.X != -1)
22109
protected bool ProcessControlShiftF10Keys(
Keys
keyData)
22131
protected bool ProcessLeftKey(
Keys
keyData) => RightToLeftInternal
22135
private bool ProcessLeftKeyPrivate(
Keys
keyData)
22171
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22173
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22177
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22282
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22284
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22288
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22391
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22393
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22397
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
22535
if ((keyData &
Keys
.Control) ==
Keys
.Control)
22537
return ProcessLeftMost((keyData &
Keys
.Shift) ==
Keys
.Shift, firstVisibleColumnIndex, firstVisibleRowIndex);
22987
protected bool ProcessNextKey(
Keys
keyData)
23101
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23141
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23177
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23250
protected bool ProcessPriorKey(
Keys
keyData)
23360
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23399
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23435
if ((keyData &
Keys
.Shift) ==
Keys
.Shift && MultiSelect)
23508
protected bool ProcessRightKey(
Keys
keyData) => RightToLeftInternal
23512
private bool ProcessRightKeyPrivate(
Keys
keyData)
23550
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23552
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23556
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23660
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23662
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23666
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23769
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23771
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
23775
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
23915
if ((keyData &
Keys
.Control) ==
Keys
.Control)
23917
return ProcessRightMost((keyData &
Keys
.Shift) ==
Keys
.Shift, lastVisibleColumnIndex, firstVisibleRowIndex);
24327
protected bool ProcessSpaceKey(
Keys
keyData)
24329
if ((keyData & (
Keys
.Control |
Keys
.Shift |
Keys
.Alt)) ==
Keys
.Shift && _ptCurrentCell.X != -1)
24412
protected bool ProcessTabKey(
Keys
keyData)
24416
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24418
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24452
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24458
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24495
case
Keys
.Tab:
24500
case
Keys
.Up:
24505
case
Keys
.Down:
24510
case
Keys
.Next:
24515
case
Keys
.Prior:
24520
case
Keys
.Left:
24525
case
Keys
.Right:
24530
case
Keys
.F2:
24535
case
Keys
.F3:
24540
case
Keys
.F10:
24550
case
Keys
.Home:
24555
case
Keys
.D0:
24556
case
Keys
.NumPad0:
24561
case
Keys
.Delete:
24566
case
Keys
.End:
24571
case
Keys
.Enter:
24576
case
Keys
.Escape:
24581
case
Keys
.A:
24586
case
Keys
.C:
24587
case
Keys
.Insert:
24592
case
Keys
.Space:
24601
protected bool ProcessUpKey(
Keys
keyData)
24624
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24626
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24718
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24822
if ((keyData &
Keys
.Control) ==
Keys
.Control)
24824
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
24909
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
25006
if ((keyData &
Keys
.Control) ==
Keys
.Control)
25008
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
25127
if ((keyData &
Keys
.Shift) ==
Keys
.Shift)
25259
if ((keyData &
Keys
.Control) ==
Keys
.Control)
25339
protected bool ProcessZeroKey(
Keys
keyData)
25359
if ((keyData & (
Keys
.Alt |
Keys
.Shift |
Keys
.Control)) ==
Keys
.Control && IsCurrentCellInEditMode)
30090
Keys
modifierKeys = ModifierKeys;
30091
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)
712
if (e.KeyCode ==
Keys
.Space && !e.Alt && !e.Control && !e.Shift)
758
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)
810
if (e.KeyCode ==
Keys
.Enter)
1416
protected override bool ProcessDialogKey(
Keys
keyData)
1418
if ((keyData & (
Keys
.Alt |
Keys
.Control)) !=
Keys
.Alt)
1420
Keys
keyCode = keyData &
Keys
.KeyCode;
1423
case
Keys
.Tab:
1426
bool forward = (keyData &
Keys
.Shift) !=
Keys
.Shift;
1434
case
Keys
.Up:
1435
case
Keys
.Left:
1442
case
Keys
.Down:
1443
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)
4264
protected override bool IsInputKey(
Keys
keyData)
4266
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
4271
switch (keyData &
Keys
.KeyCode)
4273
case
Keys
.PageUp:
4274
case
Keys
.PageDown:
4275
case
Keys
.Home:
4276
case
Keys
.End:
4288
switch (keyData &
Keys
.KeyCode)
4290
case
Keys
.Return:
4291
case
Keys
.Escape:
6769
if ((lvkd->wVKey == (short)
Keys
.Down || lvkd->wVKey == (short)
Keys
.Up) && SelectedItems.Count > 0)
6772
if (lvkd->wVKey == (short)
Keys
.Down
6783
if (lvkd->wVKey == (short)
Keys
.Up
6795
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)
3268
protected override bool ProcessDialogKey(
Keys
keyData)
3270
if ((keyData &
Keys
.KeyCode) !=
Keys
.Tab
3271
|| keyData.HasFlag(
Keys
.Control)
3272
|| keyData.HasFlag(
Keys
.Alt))
3278
if (keyData.HasFlag(
Keys
.Shift))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (77)
1526
if (_dropDownHolder?.Visible == true && m.MsgInternal == PInvokeCore.WM_KEYDOWN && (
Keys
)(nint)m.WParamInternal !=
Keys
.Tab)
1575
Keys
modifiers = ModifierKeys;
1576
if ((modifiers & ~
Keys
.Shift) != 0)
1592
case unchecked((char)(int)(long)
Keys
.Tab):
2051
protected override bool IsInputKey(
Keys
keyData)
2053
switch (keyData &
Keys
.KeyCode)
2055
case
Keys
.Escape:
2056
case
Keys
.Tab:
2057
case
Keys
.F4:
2060
case
Keys
.Return:
2351
if (e.KeyCode ==
Keys
.Return)
2459
private bool ProcessEnumUpAndDown(GridEntry entry,
Keys
keyCode, bool closeDropDown = true)
2487
if (keyCode ==
Keys
.Up)
2517
if (!e.Alt && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down))
2532
else if ((e.KeyCode ==
Keys
.Left || e.KeyCode ==
Keys
.Right)
2533
&& (e.Modifiers & ~
Keys
.Shift) != 0)
2656
if ((ModifierKeys & (
Keys
.Alt |
Keys
.Control)) != 0)
2738
Keys
keyCode = e.KeyCode;
2743
if (keyCode ==
Keys
.Tab)
2753
if (keyCode ==
Keys
.Down && altPressed && DropDownButton.Visible)
2759
if (keyCode ==
Keys
.Up && altPressed && DropDownButton.Visible && (_dropDownHolder is not null) && _dropDownHolder.Visible)
2774
case
Keys
.Up:
2775
case
Keys
.Down:
2776
int position = keyCode ==
Keys
.Up ? _selectedRow - 1 : _selectedRow + 1;
2780
case
Keys
.Left:
2799
case
Keys
.Right:
2825
case
Keys
.Return:
2836
case
Keys
.Home:
2837
case
Keys
.End:
2839
SelectGridEntry(allEntries[keyCode ==
Keys
.Home ? 0 : allEntries.Count - 1], pageIn: true);
2841
case
Keys
.Add:
2842
case
Keys
.Oemplus:
2843
case
Keys
.OemMinus:
2844
case
Keys
.Subtract:
2852
bool expand = keyCode is
Keys
.Add or
Keys
.Oemplus;
2858
case
Keys
.D8:
2861
goto case
Keys
.Multiply;
2865
case
Keys
.Multiply:
2871
case
Keys
.Prior: // PAGE_UP
2872
case
Keys
.Next: // PAGE_DOWN
2874
bool next = keyCode ==
Keys
.Next;
2903
case
Keys
.Insert:
2907
goto case
Keys
.V;
2910
goto case
Keys
.C;
2911
case
Keys
.C:
2920
case
Keys
.Delete:
2925
goto case
Keys
.X;
2929
case
Keys
.X:
2939
case
Keys
.V:
2947
case
Keys
.A:
2958
if (e.KeyData == (
Keys
.C |
Keys
.Alt |
Keys
.Shift |
Keys
.Control))
2968
&& (keyCode ==
Keys
.Up || keyCode ==
Keys
.Down))
3162
if ((ModifierKeys & (
Keys
.Shift |
Keys
.Alt)) != 0 || MouseButtons != MouseButtons.None)
3852
protected override bool ProcessDialogKey(
Keys
keyData)
3856
Keys
keyCode = keyData &
Keys
.KeyCode;
3859
case
Keys
.F4:
3873
case
Keys
.Tab:
3875
if (((keyData &
Keys
.Control) != 0) ||
3876
((keyData &
Keys
.Alt) != 0))
3881
bool forward = (keyData &
Keys
.Shift) == 0;
3943
case
Keys
.Up:
3944
case
Keys
.Down:
3945
case
Keys
.Left:
3946
case
Keys
.Right:
3948
case
Keys
.Return:
5374
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)
2686
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)
559
protected override bool IsInputKey(
Keys
keyData)
561
if (Multiline && (keyData &
Keys
.Alt) == 0)
563
switch (keyData &
Keys
.KeyCode)
565
case
Keys
.Return:
712
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
715
if (!returnValue && ShortcutsEnabled && (keyData == (
Keys
.Control |
Keys
.A)))
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (36)
167
(int)Shortcut.CtrlE, (int)Shortcut.CtrlY, (int)
Keys
.Control + (int)
Keys
.Back,
178
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
189
(int)keyData == (shortcutValue | (int)
Keys
.Shift))
213
|| (keyData != (
Keys
.Control |
Keys
.Back)
214
&& keyData != (
Keys
.Control |
Keys
.Shift |
Keys
.Back)))
1583
protected bool ContainsNavigationKeyCode(
Keys
keyCode) => keyCode switch
1585
Keys
.Up or
Keys
.Down or
Keys
.PageUp or
Keys
.PageDown
1586
or
Keys
.Home or
Keys
.End or
Keys
.Left or
Keys
.Right => true,
1641
protected override bool IsInputKey(
Keys
keyData)
1643
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
1648
switch (keyData &
Keys
.KeyCode)
1650
case
Keys
.Tab:
1653
return Multiline && _textBoxFlags[s_acceptsTab] && ((keyData &
Keys
.Control) == 0);
1655
case
Keys
.Escape:
1663
case
Keys
.Back:
1671
case
Keys
.PageUp:
1672
case
Keys
.PageDown:
1673
case
Keys
.Home:
1674
case
Keys
.End:
1790
protected override bool ProcessDialogKey(
Keys
keyData)
1792
Keys
keyCode = keyData &
Keys
.KeyCode;
1794
if (keyCode ==
Keys
.Tab && AcceptsTab && (keyData &
Keys
.Control) != 0)
1797
keyData &= ~
Keys
.Control;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (39)
56
private Dictionary<
Keys
, ToolStripMenuItem>? _shortcuts;
1645
internal Dictionary<
Keys
, ToolStripMenuItem> Shortcuts
1649
_shortcuts ??= new Dictionary<
Keys
, ToolStripMenuItem>(1);
2052
bool forward = LastKeyData ==
Keys
.Tab || (TabStop && start is null && LastKeyData !=
Keys
.Left);
2550
protected override bool IsInputKey(
Keys
keyData) =>
2641
internal bool ProcessCmdKeyInternal(ref Message m,
Keys
keyData)
2674
protected override bool ProcessCmdKey(ref Message m,
Keys
keyData)
2713
(keyData &
Keys
.Control) ==
Keys
.Control && (keyData &
Keys
.KeyCode) ==
Keys
.Tab;
2718
&& ToolStripManager.SelectNextToolStrip(this, forward: (keyData &
Keys
.Shift) ==
Keys
.None))
2737
protected override bool ProcessDialogKey(
Keys
keyData)
2755
bool hasModifiers = ((keyData & (
Keys
.Alt |
Keys
.Control)) !=
Keys
.None);
2757
Keys
keyCode = keyData &
Keys
.KeyCode;
2760
case
Keys
.Back:
2770
case
Keys
.Tab:
2774
retVal = ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None);
2778
case
Keys
.Left:
2779
case
Keys
.Right:
2780
case
Keys
.Up:
2781
case
Keys
.Down:
2784
case
Keys
.Home:
2788
case
Keys
.End:
2792
case
Keys
.Escape: // escape and menu key should restore focus
2847
if (!inMenuMode && ModifierKeys ==
Keys
.Alt)
3036
internal virtual bool ProcessArrowKey(
Keys
keyCode)
3043
case
Keys
.Left:
3044
case
Keys
.Right:
3045
retVal = ProcessLeftRightArrowKey(keyCode ==
Keys
.Right);
3047
case
Keys
.Up:
3048
case
Keys
.Down:
3052
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)
52
protected override bool IsInputKey(
Keys
keyData)
54
if ((keyData &
Keys
.Alt) ==
Keys
.Alt)
56
switch (keyData &
Keys
.KeyCode)
58
case
Keys
.Down:
59
case
Keys
.Up:
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (2)
828
protected internal override bool ProcessCmdKey(ref Message m,
Keys
keyData) => false;
833
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)
556
protected internal override bool ProcessCmdKey(ref Message m,
Keys
keyData)
566
protected internal override bool ProcessDialogKey(
Keys
keyData)
568
Keys
keyCode = keyData &
Keys
.KeyCode;
575
if (isTopLevel && (keyCode ==
Keys
.Down || keyCode ==
Keys
.Up || keyCode ==
Keys
.Enter || (SupportsSpaceKey && keyCode ==
Keys
.Space)))
591
bool forward = ((keyCode ==
Keys
.Enter) || (SupportsSpaceKey && keyCode ==
Keys
.Space));
592
forward = (forward || (menusCascadeRight && keyCode ==
Keys
.Left) || (!menusCascadeRight && keyCode ==
Keys
.Right));
610
if (isTopLevel && (keyCode ==
Keys
.Down || keyCode ==
Keys
.Up))
619
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:
2268
if (CheckBoxes && (e.KeyData &
Keys
.KeyCode) ==
Keys
.Space)
2298
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)
427
if (InterceptArrowKeys && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down) && !Spinning)
440
if (InterceptArrowKeys && (e.KeyCode ==
Keys
.Up || e.KeyCode ==
Keys
.Down))
479
else if ((ModifierKeys & (
Keys
.Control |
Keys
.Alt)) != 0)
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (5)
692
if (e.KeyData ==
Keys
.Up)
699
else if (e.KeyData ==
Keys
.Down)
707
if (e.KeyCode ==
Keys
.Return && UserEdit)
831
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)
4749
protected override bool ProcessCmdKey(ref Message msg,
Keys
keyData)
4779
protected override bool ProcessDialogKey(
Keys
keyData)
4781
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
4783
Keys
keyCode = keyData &
Keys
.KeyCode;
4787
case
Keys
.Return:
4800
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))
2306
protected override bool ProcessDialogKey(
Keys
keyData)
2308
if ((keyData & (
Keys
.Alt |
Keys
.Control)) ==
Keys
.None)
2310
Keys
keyCode = keyData &
Keys
.KeyCode;
2313
case
Keys
.Tab:
2314
if (ProcessTabKey((keyData &
Keys
.Shift) ==
Keys
.None))
2320
case
Keys
.Left:
2321
case
Keys
.Right:
2322
case
Keys
.Up:
2323
case
Keys
.Down:
2326
if (ProcessArrowKey(keyCode is
Keys
.Right or
2327
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)
928
Keys
keyData = (
Keys
)(nint)msg.WParamInternal | ModifierKeys;
936
switch (keyData &
Keys
.KeyCode)
938
case
Keys
.PageUp:
939
if ((keyData &
Keys
.Modifiers) ==
Keys
.Control)
971
case
Keys
.PageDown:
972
if ((keyData &
Keys
.Modifiers) ==
Keys
.Control)
1005
case
Keys
.Home:
1006
if ((keyData &
Keys
.Modifiers) ==
Keys
.Control)
1012
case
Keys
.End:
1013
if (_pageInfo is not null && (keyData &
Keys
.Modifiers) ==
Keys
.Control)
1020
case
Keys
.Up:
1038
case
Keys
.Down:
1058
case
Keys
.Left:
1076
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)
653
case
Keys
.Delete:
656
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)
100
protected override bool ProcessDialogKey(
Keys
keyData)
102
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)
315
protected override bool ProcessDialogKey(
Keys
keyData)
317
if ((keyData &
Keys
.KeyCode) ==
Keys
.Return && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
323
if ((keyData &
Keys
.KeyCode) ==
Keys
.Escape && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
329
if ((keyData &
Keys
.KeyCode) ==
Keys
.Tab && (keyData & (
Keys
.Alt |
Keys
.Control)) == 0)
335
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)
1873
protected override bool IsInputKey(
Keys
key)
1875
return (key ==
Keys
.Return) || base.IsInputKey(key);
2088
if (e.KeyData ==
Keys
.Return && SelectedNode is not null)
2097
protected override bool IsInputKey(
Keys
key)
2099
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)
81
protected override bool ProcessDialogKey(
Keys
keyData)
83
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);