VirtualKey enumeration

VirtualKey enumeration

Specifies the values for each virtual key.

The keys listed below are virtual, which means that they are not the physical keys or buttons on an attached keyboard or device, but an abstract mapping of those keys that may be connected to hardware that provides either those keys and buttons or an interface that simulates their physical behavior (such as an onscreen touch keyboard).


var value = Windows.System.VirtualKey.none;


The VirtualKey enumeration has these members.

None | none0

No virtual key value.

LeftButton | leftButton1

The left mouse button.

RightButton | rightButton2

The right mouse button.

Cancel | cancel3

The cancel key or button.

MiddleButton | middleButton4

The middle mouse button.

XButton1 | xButton15

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

XButton2 | xButton26

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

Back | back8

The virtual back key or button.

Tab | tab9

The Tab key.

Clear | clear12

The Clear key or button.

Enter | enter13

The Enter key.

Shift | shift16

The Shift key. 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 | control17

The Ctrl key. 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 | menu18

The menu key or button.

Pause | pause19

The Pause key or button.

CapitalLock | capitalLock20

The Caps Lock key or button.

Kana | kana21

The Kana symbol key-shift button.

Hangul | hangul21

The Hangul symbol key-shift button.

Junja | junja23

The Junja symbol key-shift button.

Final | final24

The Final symbol key-shift button.

Hanja | hanja25

The Hanja symbol key shift button.

Kanji | kanji25

The Kanji symbol key-shift button.

Escape | escape27

The Esc key.

Convert | convert28

The convert button or key.

NonConvert | nonConvert29

The nonconvert button or key.

Accept | accept30

The accept button or key.

ModeChange | modeChange31

The mode change key.

Space | space32

The Spacebar key or button.

PageUp | pageUp33

The Page Up key.

PageDown | pageDown34

The Page Down key.

End | end35

The End key.

Home | home36

The Home key.

Left | left37

The Left Arrow key.

Up | up38

The Up Arrow key.

Right | right39

The Right Arrow key.

Down | down40

The Down Arrow key.

Select | select41

The Select key or button.

Print | print42

The Print key or button.

Execute | execute43

The execute key or button.

Snapshot | snapshot44

The snapshot key or button.

Insert | insert45

The Insert key.

Delete | delete46

The Delete key.

Help | help47

The Help key or button.

Number0 | number048

The number "0" key.

Number1 | number149

The number "1" key.

Number2 | number250

The number "2" key.

Number3 | number351

The number "3" key.

Number4 | number452

The number "4" key.

Number5 | number553

The number "5" key.

Number6 | number654

The number "6" key.

Number7 | number755

The number "7" key.

Number8 | number856

The number "8" key.

Number9 | number957

The number "9" key.

A | a65

The letter "A" key.

B | b66

The letter "B" key.

C | c67

The letter "C" key.

D | d68

The letter "D" key.

E | e69

The letter "E" key.

F | f70

The letter "F" key.

G | g71

The letter "G" key.

H | h72

The letter "H" key.

I | i73

The letter "I" key.

J | j74

The letter "J" key.

K | k75

The letter "K" key.

L | l76

The letter "L" key.

M | m77

The letter "M" key.

N | n78

The letter "N" key.

O | o79

The letter "O" key.

P | p80

The letter "P" key.

Q | q81

The letter "Q" key.

R | r82

The letter "R" key.

S | s83

The letter "S" key.

T | t84

The letter "T" key.

U | u85

The letter "U" key.

V | v86

The letter "V" key.

W | w87

The letter "W" key.

X | x88

The letter "X" key.

Y | y89

The letter "Y" key.

Z | z90

The letter "Z" key.

LeftWindows | leftWindows91

The left Windows key.

RightWindows | rightWindows92

The right Windows key.

Application | application93

The application key or button.

Sleep | sleep95

The sleep key or button.

NumberPad0 | numberPad096

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

NumberPad1 | numberPad197

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

NumberPad2 | numberPad298

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

NumberPad3 | numberPad399

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

NumberPad4 | numberPad4100

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

NumberPad5 | numberPad5101

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

NumberPad6 | numberPad6102

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

NumberPad7 | numberPad7103

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

NumberPad8 | numberPad8104

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

NumberPad9 | numberPad9105

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

Multiply | multiply106

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

Add | add107

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

Separator | separator108

The separator key as located on a numeric pad.

Subtract | subtract109

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

Decimal | decimal110

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

Divide | divide111

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

F1 | f1112

The F1 function key.

F2 | f2113

The F2 function key.

F3 | f3114

The F3 function key.

F4 | f4115

The F4 function key.

F5 | f5116

The F5 function key.

F6 | f6117

The F6 function key.

F7 | f7118

The F7 function key.

F8 | f8119

The F8 function key.

F9 | f9120

The F9 function key.

F10 | f10121

The F10 function key.

F11 | f11122

The F11 function key.

F12 | f12123

The F12 function key.

F13 | f13124

The F13 function key.

F14 | f14125

The F14 function key.

F15 | f15126

The F15 function key.

F16 | f16127

The F16 function key.

F17 | f17128

The F17 function key.

F18 | f18129

The F18 function key.

F19 | f19130

The F19 function key.

F20 | f20131

The F20 function key.

F21 | f21132

The F21 function key.

F22 | f22133

The F22 function key.

F23 | f23134

The F23 function key.

F24 | f24135

The F24 function key.

NavigationView | navigationView136

The navigation up button.

NavigationMenu | navigationMenu137

The navigation menu button.

NavigationUp | navigationUp138

The navigation up button.

NavigationDown | navigationDown139

The navigation down button.

NavigationLeft | navigationLeft140

The navigation left button.

NavigationRight | navigationRight141

The navigation right button.

NavigationAccept | navigationAccept142

The navigation accept button.

NavigationCancel | navigationCancel143

The navigation cancel button.

NumberKeyLock | numberKeyLock144

The Num Lock key.

Scroll | scroll145

The Scroll Lock (ScrLk) key.

LeftShift | leftShift160

The left Shift key.

RightShift | rightShift161

The right Shift key.

LeftControl | leftControl162

The left Ctrl key.

RightControl | rightControl163

The right Ctrl key.

LeftMenu | leftMenu164

The left menu key.

RightMenu | rightMenu165

The right menu key.

GoBack | goBack166

The go back key.

GoForward | goForward167

The go forward key.

Refresh | refresh168

The refresh key.

Stop | stop169

The stop key.

Search | search170

The search key.

Favorites | favorites171

The favorites key.

GoHome | goHome172

The go home key.

GamepadA | gamepadA195

The gamepad A button.

GamepadB | gamepadB196

The gamepad B button.

GamepadX | gamepadX197

The gamepad X button.

GamepadY | gamepadY198

The gamepad Y button.

GamepadRightShoulder | gamepadRightShoulder199

The gamepad right shoulder.

GamepadLeftShoulder | gamepadLeftShoulder200

The gamepad left shoulder.

GamepadLeftTrigger | gamepadLeftTrigger201

The gamepad left trigger.

GamepadRightTrigger | gamepadRightTrigger202

The gamepad right trigger.

GamepadDPadUp | gamepadDPadUp203

The gamepad d-pad up.

GamepadDPadDown | gamepadDPadDown204

The gamepad d-pad down.

GamepadDPadLeft | gamepadDPadLeft205

The gamepad d-pad left.

GamepadDPadRight | gamepadDPadRight206

The gamepad d-pad right.

GamepadMenu | gamepadMenu207

The gamepad menu button.

GamepadView | gamepadView208

The gamepad view button.

GamepadLeftThumbstickButton | gamepadLeftThumbstickButton209

The gamepad left thumbstick button.

GamepadRightThumbstickButton | gamepadRightThumbstickButton210

The gamepad right thumbstick button.

GamepadLeftThumbstickUp | gamepadLeftThumbstickUp211

The gamepad left thumbstick up.

GamepadLeftThumbstickDown | gamepadLeftThumbstickDown212

The gamepad left thumbstick down.

GamepadLeftThumbstickRight | gamepadLeftThumbstickRight213

The gamepad left thumbstick right.

GamepadLeftThumbstickLeft | gamepadLeftThumbstickLeft214

The gamepad left thumbstick left.

GamepadRightThumbstickUp | gamepadRightThumbstickUp215

The gamepad right thumbstick up.

GamepadRightThumbstickDown | gamepadRightThumbstickDown216

The gamepad right thumbstick down.

GamepadRightThumbstickRight | gamepadRightThumbstickRight217

The gamepad right thumbstick right.

GamepadRightThumbstickLeft | gamepadRightThumbstickLeft218

The gamepad right thumbstick left.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::System [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8


Windows::System [C++]







© 2016 Microsoft