VirtualKey Enum

Definition

Specifies the values for each virtual key.

public enum class VirtualKey
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class VirtualKey
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum VirtualKey
var value = Windows.System.VirtualKey.none
Public Enum VirtualKey
Inheritance
VirtualKey
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

Name Value Description
None 0

No virtual key value.

LeftButton 1

The left mouse button.

RightButton 2

The right mouse button.

Cancel 3

The cancel key or button.

MiddleButton 4

The middle mouse button.

XButton1 5

An additional "extended" device key or button (for example, an additional mouse button).

XButton2 6

An additional "extended" device key or button (for example, an additional mouse button).

Back 8

The back key or button.

Tab 9

The Tab key or button.

Clear 12

The Clear key or button.

Enter 13

The Enter key or button.

Shift 16

The Shift key or button. This is the general Shift case, applicable to key layouts with only one Shift key or that do not need to differentiate between left Shift and right Shift keystrokes.

Control 17

The Ctrl key or button. This is the general Ctrl case, applicable to key layouts with only one Ctrl key or that do not need to differentiate between left Ctrl and right Ctrl keystrokes.

Menu 18

The Alt key or button. This is the general Alt case, applicable to key layouts with only one Alt key or that do not need to differentiate between left Alt and right Alt keystrokes.

Pause 19

The Pause key or button.

CapitalLock 20

The Caps Lock key or button.

Hangul 21

The Hangul symbol option key or button.

Hangul are the syllabaries that form parts of the Korean writing system.

Kana 21

The Kana symbol option key or button.

Kana are the syllabaries that form parts of the Japanese writing system.

ImeOn 22

The Input Method Editor On key or button.

Junja 23

The Junja symbol option key or button.

Junja are the syllabaries that form parts of the Korean writing system.

Final 24

The Final symbol key or button.

Hanja 25

The Hanja symbol option key or button.

Hanja are the syllabaries that form parts of the Korean writing system.

Kanji 25

The Kanji symbol option key or button.

Kanji are the syllabaries that form parts of the Japanese writing system.

ImeOff 26

The Input Method Editor Off key or button.

Escape 27

The Esc key or button.

Convert 28

The IME convert button.

NonConvert 29

The IME nonconvert button.

Accept 30

The IME accept button.

ModeChange 31

The IME mode change button.

Space 32

The Spacebar key or button.

PageUp 33

The Page Up key or button.

PageDown 34

The Page Down key or button.

End 35

The End key or button.

Home 36

The Home key or button.

Left 37

The Left Arrow key or button.

Up 38

The Up Arrow key or button.

Right 39

The Right Arrow key or button.

Down 40

The Down Arrow key or button.

Select 41

The Select key or button.

Print 42

The Print key or button.

Execute 43

The execute key or button.

Snapshot 44

The Print Screen key or button.

Insert 45

The Insert key or button.

Delete 46

The Delete key or button.

Help 47

The Help key or button.

Number0 48

The number "0" key or button.

Number1 49

The number "1" key or button.

Number2 50

The number "2" key or button.

Number3 51

The number "3" key or button.

Number4 52

The number "4" key or button.

Number5 53

The number "5" key or button.

Number6 54

The number "6" key or button.

Number7 55

The number "7" key or button.

Number8 56

The number "8" key or button.

Number9 57

The number "9" key or button.

A 65

The letter "A" key or button.

B 66

The letter "B" key or button.

C 67

The letter "C" key or button.

D 68

The letter "D" key or button.

E 69

The letter "E" key or button.

F 70

The letter "F" key or button.

G 71

The letter "G" key or button.

H 72

The letter "H" key or button.

I 73

The letter "I" key or button.

J 74

The letter "J" key or button.

K 75

The letter "K" key or button.

L 76

The letter "L" key or button.

M 77

The letter "M" key or button.

N 78

The letter "N" key or button.

O 79

The letter "O" key or button.

P 80

The letter "P" key or button.

Q 81

The letter "Q" key or button.

R 82

The letter "R" key or button.

S 83

The letter "S" key or button.

T 84

The letter "T" key or button.

U 85

The letter "U" key or button.

V 86

The letter "V" key or button.

W 87

The letter "W" key or button.

X 88

The letter "X" key or button.

Y 89

The letter "Y" key or button.

Z 90

The letter "Z" key or button.

LeftWindows 91

The left Windows key or button.

RightWindows 92

The right Windows key or button.

Application 93

The application key or button.

Sleep 95

The sleep key or button.

NumberPad0 96

The number "0" key or button as located on a numeric pad.

NumberPad1 97

The number "1" key or button as located on a numeric pad.

NumberPad2 98

The number "2" key or button as located on a numeric pad.

NumberPad3 99

The number "3" key or button as located on a numeric pad.

NumberPad4 100

The number "4" key or button as located on a numeric pad.

NumberPad5 101

The number "5" key or button as located on a numeric pad.

NumberPad6 102

The number "6" key or button as located on a numeric pad.

NumberPad7 103

The number "7" key or button as located on a numeric pad.

NumberPad8 104

The number "8" key or button as located on a numeric pad.

NumberPad9 105

The number "9" key or button as located on a numeric pad.

Multiply 106

The multiply (*) operation key or button as located on a numeric pad.

Add 107

The add (+) operation key or button as located on a numeric pad.

Separator 108

The separator key or button as located on a numeric pad.

Subtract 109

The subtract (-) operation key or button as located on a numeric pad.

Decimal 110

The decimal (.) key or button as located on a numeric pad.

Divide 111

The divide (/) operation key or button as located on a numeric pad.

F1 112

The F1 function key or button.

F2 113

The F2 function key or button.

F3 114

The F3 function key or button.

F4 115

The F4 function key or button.

F5 116

The F5 function key or button.

F6 117

The F6 function key or button.

F7 118

The F7 function key or button.

F8 119

The F8 function key or button.

F9 120

The F9 function key or button.

F10 121

The F10 function key or button.

F11 122

The F11 function key or button.

F12 123

The F12 function key or button.

F13 124

The F13 function key or button.

F14 125

The F14 function key or button.

F15 126

The F15 function key or button.

F16 127

The F16 function key or button.

F17 128

The F17 function key or button.

F18 129

The F18 function key or button.

F19 130

The F19 function key or button.

F20 131

The F20 function key or button.

F21 132

The F21 function key or button.

F22 133

The F22 function key or button.

F23 134

The F23 function key or button.

F24 135

The F24 function key or button.

NavigationView 136

The navigation up key or button.

NavigationMenu 137

The navigation menu key or button.

NavigationUp 138

The navigation up key or button.

NavigationDown 139

The navigation down key or button.

NavigationLeft 140

The navigation left key or button.

NavigationRight 141

The navigation right key or button.

NavigationAccept 142

The navigation accept key or button.

NavigationCancel 143

The navigation cancel key or button.

NumberKeyLock 144

The Num Lock key or button.

Scroll 145

The Scroll Lock (ScrLk) key or button.

LeftShift 160

The left Shift key or button.

RightShift 161

The right Shift key or button.

LeftControl 162

The left Ctrl key or button.

RightControl 163

The right Ctrl key or button.

LeftMenu 164

The left Alt key or button.

RightMenu 165

The right Alt key or button.

GoBack 166

The go back key or button.

GoForward 167

The go forward key or button.

Refresh 168

The refresh key or button.

Stop 169

The stop key or button.

170

The search key or button.

Favorites 171

The favorites key or button.

GoHome 172

The go home key or button.

GamepadA 195

The gamepad A button.

GamepadB 196

The gamepad B button.

GamepadX 197

The gamepad X button.

GamepadY 198

The gamepad Y button.

GamepadRightShoulder 199

The gamepad right shoulder.

GamepadLeftShoulder 200

The gamepad left shoulder.

GamepadLeftTrigger 201

The gamepad left trigger.

GamepadRightTrigger 202

The gamepad right trigger.

GamepadDPadUp 203

The gamepad d-pad up.

GamepadDPadDown 204

The gamepad d-pad down.

GamepadDPadLeft 205

The gamepad d-pad left.

GamepadDPadRight 206

The gamepad d-pad right.

GamepadMenu 207

The gamepad menu button.

GamepadView 208

The gamepad view button.

GamepadLeftThumbstickButton 209

The gamepad left thumbstick button.

GamepadRightThumbstickButton 210

The gamepad right thumbstick button.

GamepadLeftThumbstickUp 211

The gamepad left thumbstick up.

GamepadLeftThumbstickDown 212

The gamepad left thumbstick down.

GamepadLeftThumbstickRight 213

The gamepad left thumbstick right.

GamepadLeftThumbstickLeft 214

The gamepad left thumbstick left.

GamepadRightThumbstickUp 215

The gamepad right thumbstick up.

GamepadRightThumbstickDown 216

The gamepad right thumbstick down.

GamepadRightThumbstickRight 217

The gamepad right thumbstick right.

GamepadRightThumbstickLeft 218

The gamepad right thumbstick left.

Remarks

This enum is used in the Windows.UI.Core.KeyEventArgs.VirtualKey, Windows.UI.Core.AcceleratorKeyEventArgs.VirtualKey, Windows.UI.Xaml.Input.KeyRoutedEventArgs.Key, Windows.UI.Xaml.Input.KeyboardAccelerator.Key, and Windows.UI.Xaml.Input.ProcessKeyboardAcceleratorEventArgs.Key properties.

For more information, including code examples, see Keyboard events and Keyboard Accelerators.

Applies to

See also