Skip to main content
Version: 15.x (API 15) [Legacy]

Enum VirtualKey

Virtual-key codes.

Remarks​

Defined in winuser.h from Windows SDK v6.1.

Assembly: Dalamud.dll​
Declaration
public enum VirtualKey : ushort

Fields​

NO_KEY​

This is an addendum to use on functions in which you have to pass a zero value to represent no key code.

Declaration
NO_KEY = 0

LBUTTON​

Left mouse button.

Declaration
LBUTTON = 1

RBUTTON​

Right mouse button.

Declaration
RBUTTON = 2

CANCEL​

Control-break processing.

Declaration
CANCEL = 3

MBUTTON​

Middle mouse button (three-button mouse).

Declaration
MBUTTON = 4
Remarks​

NOT contiguous with L and R buttons.

XBUTTON1​

X1 mouse button.

Declaration
XBUTTON1 = 5
Remarks​

NOT contiguous with L and R buttons.

XBUTTON2​

X2 mouse button.

Declaration
XBUTTON2 = 6
Remarks​

NOT contiguous with L and R buttons.

BACK​

BACKSPACE key.

Declaration
BACK = 8

TAB​

TAB key.

Declaration
TAB = 9

CLEAR​

CLEAR key.

Declaration
CLEAR = 12

RETURN​

RETURN key.

Declaration
RETURN = 13

SHIFT​

SHIFT key.

Declaration
SHIFT = 16

CONTROL​

CONTROL key.

Declaration
CONTROL = 17

ALT key.

Declaration
MENU = 18

PAUSE​

PAUSE key.

Declaration
PAUSE = 19

CAPITAL​

CAPS LOCK key.

Declaration
CAPITAL = 20

KANA​

IME Kana mode.

Declaration
KANA = 21

HANGEUL​

IME Hangeul mode (maintained for compatibility; use User32.VirtualKey.HANGUL).

Declaration
HANGEUL = 21

HANGUL​

IME Hangul mode.

Declaration
HANGUL = 21

JUNJA​

IME Junja mode.

Declaration
JUNJA = 23

FINAL​

IME final mode.

Declaration
FINAL = 24

HANJA​

IME Hanja mode.

Declaration
HANJA = 25

KANJI​

IME Kanji mode.

Declaration
KANJI = 25

ESCAPE​

ESC key.

Declaration
ESCAPE = 27

CONVERT​

IME convert.

Declaration
CONVERT = 28

NONCONVERT​

IME nonconvert.

Declaration
NONCONVERT = 29

ACCEPT​

IME accept.

Declaration
ACCEPT = 30

MODECHANGE​

IME mode change request.

Declaration
MODECHANGE = 31

SPACE​

SPACEBAR.

Declaration
SPACE = 32

PRIOR​

PAGE UP key.

Declaration
PRIOR = 33

NEXT​

PAGE DOWN key.

Declaration
NEXT = 34

END​

END key.

Declaration
END = 35

HOME​

HOME key.

Declaration
HOME = 36

LEFT​

LEFT ARROW key.

Declaration
LEFT = 37

UP​

UP ARROW key.

Declaration
UP = 38

RIGHT ARROW key.

Declaration
RIGHT = 39

DOWN​

DOWN ARROW key.

Declaration
DOWN = 40

SELECT​

SELECT key.

Declaration
SELECT = 41

PRINT​

PRINT key.

Declaration
PRINT = 42

EXECUTE​

EXECUTE key.

Declaration
EXECUTE = 43

SNAPSHOT​

PRINT SCREEN key.

Declaration
SNAPSHOT = 44

INSERT​

INS key.

Declaration
INSERT = 45

DELETE​

DEL key.

Declaration
DELETE = 46

HELP​

HELP key.

Declaration
HELP = 47

KEY_0​

0 key.

Declaration
KEY_0 = 48

KEY_1​

1 key.

Declaration
KEY_1 = 49

KEY_2​

2 key.

Declaration
KEY_2 = 50

KEY_3​

3 key.

Declaration
KEY_3 = 51

KEY_4​

4 key.

Declaration
KEY_4 = 52

KEY_5​

5 key.

Declaration
KEY_5 = 53

KEY_6​

6 key.

Declaration
KEY_6 = 54

KEY_7​

7 key.

Declaration
KEY_7 = 55

KEY_8​

8 key.

Declaration
KEY_8 = 56

KEY_9​

9 key.

Declaration
KEY_9 = 57

A​

A key.

Declaration
A = 65

B​

B key.

Declaration
B = 66

C​

C key.

Declaration
C = 67

D​

D key.

Declaration
D = 68

E​

E key.

Declaration
E = 69

F​

F key.

Declaration
F = 70

G​

G key.

Declaration
G = 71

H​

H key.

Declaration
H = 72

I​

I key.

Declaration
I = 73

J​

J key.

Declaration
J = 74

K​

K key.

Declaration
K = 75

L​

L key.

Declaration
L = 76

M​

M key.

Declaration
M = 77

N​

N key.

Declaration
N = 78

O​

O key.

Declaration
O = 79

P​

P key.

Declaration
P = 80

Q​

Q key.

Declaration
Q = 81

R​

R key.

Declaration
R = 82

S​

S key.

Declaration
S = 83

T​

T key.

Declaration
T = 84

U​

U key.

Declaration
U = 85

V​

V key.

Declaration
V = 86

W​

W key.

Declaration
W = 87

X​

X key.

Declaration
X = 88

Y​

Y key.

Declaration
Y = 89

Z​

Z key.

Declaration
Z = 90

LWIN​

Left Windows key (Natural keyboard).

Declaration
LWIN = 91

RWIN​

Right Windows key (Natural keyboard).

Declaration
RWIN = 92

APPS​

Applications key (Natural keyboard).

Declaration
APPS = 93

SLEEP​

Computer Sleep key.

Declaration
SLEEP = 95

NUMPAD0​

Numeric keypad 0 key.

Declaration
NUMPAD0 = 96

NUMPAD1​

Numeric keypad 1 key.

Declaration
NUMPAD1 = 97

NUMPAD2​

Numeric keypad 2 key.

Declaration
NUMPAD2 = 98

NUMPAD3​

Numeric keypad 3 key.

Declaration
NUMPAD3 = 99

NUMPAD4​

Numeric keypad 4 key.

Declaration
NUMPAD4 = 100

NUMPAD5​

Numeric keypad 5 key.

Declaration
NUMPAD5 = 101

NUMPAD6​

Numeric keypad 6 key.

Declaration
NUMPAD6 = 102

NUMPAD7​

Numeric keypad 7 key.

Declaration
NUMPAD7 = 103

NUMPAD8​

Numeric keypad 8 key.

Declaration
NUMPAD8 = 104

NUMPAD9​

Numeric keypad 9 key.

Declaration
NUMPAD9 = 105

MULTIPLY​

Multiply key.

Declaration
MULTIPLY = 106

ADD​

Add key.

Declaration
ADD = 107

SEPARATOR​

Separator key.

Declaration
SEPARATOR = 108

SUBTRACT​

Subtract key.

Declaration
SUBTRACT = 109

DECIMAL​

Decimal key.

Declaration
DECIMAL = 110

DIVIDE​

Divide key.

Declaration
DIVIDE = 111

F1​

F1 Key.

Declaration
F1 = 112

F2​

F2 Key.

Declaration
F2 = 113

F3​

F3 Key.

Declaration
F3 = 114

F4​

F4 Key.

Declaration
F4 = 115

F5​

F5 Key.

Declaration
F5 = 116

F6​

F6 Key.

Declaration
F6 = 117

F7​

F7 Key.

Declaration
F7 = 118

F8​

F8 Key.

Declaration
F8 = 119

F9​

F9 Key.

Declaration
F9 = 120

F10​

F10 Key.

Declaration
F10 = 121

F11​

F11 Key.

Declaration
F11 = 122

F12​

F12 Key.

Declaration
F12 = 123

F13​

F13 Key.

Declaration
F13 = 124

F14​

F14 Key.

Declaration
F14 = 125

F15​

F15 Key.

Declaration
F15 = 126

F16​

F16 Key.

Declaration
F16 = 127

F17​

F17 Key.

Declaration
F17 = 128

F18​

F18 Key.

Declaration
F18 = 129

F19​

F19 Key.

Declaration
F19 = 130

F20​

F20 Key.

Declaration
F20 = 131

F21​

F21 Key.

Declaration
F21 = 132

F22​

F22 Key.

Declaration
F22 = 133

F23​

F23 Key.

Declaration
F23 = 134

F24​

F24 Key.

Declaration
F24 = 135

NUMLOCK​

NUM LOCK key.

Declaration
NUMLOCK = 144

SCROLL​

SCROLL LOCK key.

Declaration
SCROLL = 145

OEM_NEC_EQUAL​

'=' key on numpad (NEC PC-9800 kbd definitions).

Declaration
OEM_NEC_EQUAL = 146

OEM_FJ_JISHO​

'Dictionary' key (Fujitsu/OASYS kbd definitions).

Declaration
OEM_FJ_JISHO = 146

OEM_FJ_MASSHOU​

'Unregister word' key (Fujitsu/OASYS kbd definitions).

Declaration
OEM_FJ_MASSHOU = 147

OEM_FJ_TOUROKU​

'Register word' key (Fujitsu/OASYS kbd definitions).

Declaration
OEM_FJ_TOUROKU = 148

OEM_FJ_LOYA​

'Left OYAYUBI' key (Fujitsu/OASYS kbd definitions).

Declaration
OEM_FJ_LOYA = 149

OEM_FJ_ROYA​

'Right OYAYUBI' key (Fujitsu/OASYS kbd definitions).

Declaration
OEM_FJ_ROYA = 150

LSHIFT​

Left SHIFT key.

Declaration
LSHIFT = 160
Remarks​

Used only as parameters to User32.GetAsyncKeyState and User32.GetKeyState. No other API or message will distinguish left and right keys in this way.

RSHIFT​

Right SHIFT key.

Declaration
RSHIFT = 161

LCONTROL​

Left CONTROL key.

Declaration
LCONTROL = 162

RCONTROL​

Right CONTROL key.

Declaration
RCONTROL = 163

Left MENU key.

Declaration
LMENU = 164

RMENU​

Right MENU key.

Declaration
RMENU = 165

BROWSER_BACK​

Browser Back key.

Declaration
BROWSER_BACK = 166

BROWSER_FORWARD​

Browser Forward key.

Declaration
BROWSER_FORWARD = 167

BROWSER_REFRESH​

Browser Refresh key.

Declaration
BROWSER_REFRESH = 168

BROWSER_STOP​

Browser Stop key.

Declaration
BROWSER_STOP = 169

Browser Search key.

Declaration
BROWSER_SEARCH = 170

BROWSER_FAVORITES​

Browser Favorites key.

Declaration
BROWSER_FAVORITES = 171

BROWSER_HOME​

Browser Start and Home key.

Declaration
BROWSER_HOME = 172

VOLUME_MUTE​

Volume Mute key.

Declaration
VOLUME_MUTE = 173

VOLUME_DOWN​

Volume Down key.

Declaration
VOLUME_DOWN = 174

VOLUME_UP​

Volume Up key.

Declaration
VOLUME_UP = 175

MEDIA_NEXT_TRACK​

Next Track key.

Declaration
MEDIA_NEXT_TRACK = 176

MEDIA_PREV_TRACK​

Previous Track key.

Declaration
MEDIA_PREV_TRACK = 177

MEDIA_STOP​

Stop Media key.

Declaration
MEDIA_STOP = 178

MEDIA_PLAY_PAUSE​

Play/Pause Media key.

Declaration
MEDIA_PLAY_PAUSE = 179

LAUNCH_MAIL​

Start Mail key.

Declaration
LAUNCH_MAIL = 180

LAUNCH_MEDIA_SELECT​

Select Media key.

Declaration
LAUNCH_MEDIA_SELECT = 181

LAUNCH_APP1​

Start Application 1 key.

Declaration
LAUNCH_APP1 = 182

LAUNCH_APP2​

Start Application 2 key.

Declaration
LAUNCH_APP2 = 183

OEM_1​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_1 = 186
Remarks​

For the US standard keyboard, the ';:' key.

OEM_PLUS​

For any country/region, the '+' key.

Declaration
OEM_PLUS = 187

OEM_COMMA​

For any country/region, the ',' key.

Declaration
OEM_COMMA = 188

OEM_MINUS​

For any country/region, the '-' key.

Declaration
OEM_MINUS = 189

OEM_PERIOD​

For any country/region, the '.' key.

Declaration
OEM_PERIOD = 190

OEM_2​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_2 = 191
Remarks​

For the US standard keyboard, the '/?' key.

OEM_3​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_3 = 192
Remarks​

For the US standard keyboard, the '`~' key.

OEM_4​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_4 = 219
Remarks​

For the US standard keyboard, the '[{' key.

OEM_5​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_5 = 220
Remarks​

For the US standard keyboard, the '|' key.

OEM_6​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_6 = 221
Remarks​

For the US standard keyboard, the ']}' key.

OEM_7​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_7 = 222
Remarks​

For the US standard keyboard, the 'single-quote/double-quote' (''"') key.

OEM_8​

Used for miscellaneous characters; it can vary by keyboard..

Declaration
OEM_8 = 223

OEM_AX​

OEM specific.

Declaration
OEM_AX = 225
Remarks​

'AX' key on Japanese AX kbd.

OEM_102​

Either the angle bracket ("<>") key or the backslash ("|") key on the RT 102-key keyboard.

Declaration
OEM_102 = 226

ICO_HELP​

OEM specific.

Declaration
ICO_HELP = 227
Remarks​

Help key on ICO.

ICO_00​

OEM specific.

Declaration
ICO_00 = 228
Remarks​

00 key on ICO.

PROCESSKEY​

IME PROCESS key.

Declaration
PROCESSKEY = 229

ICO_CLEAR​

OEM specific.

Declaration
ICO_CLEAR = 230
Remarks​

Clear key on ICO.

PACKET​

Used to pass Unicode characters as if they were keystrokes. The PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods..

Declaration
PACKET = 231
Remarks​

For more information, see Remark in User32.KEYBDINPUT, User32.SendInput, User32.WindowMessage.WM_KEYDOWN, and User32.WindowMessage.WM_KEYUP.

OEM_RESET​

Nokia/Ericsson definition.

Declaration
OEM_RESET = 233

OEM_JUMP​

Nokia/Ericsson definition.

Declaration
OEM_JUMP = 234

OEM_PA1​

Nokia/Ericsson definition.

Declaration
OEM_PA1 = 235

OEM_PA2​

Nokia/Ericsson definition.

Declaration
OEM_PA2 = 236

OEM_PA3​

Nokia/Ericsson definition.

Declaration
OEM_PA3 = 237

OEM_WSCTRL​

Nokia/Ericsson definition.

Declaration
OEM_WSCTRL = 238

OEM_CUSEL​

Nokia/Ericsson definition.

Declaration
OEM_CUSEL = 239

OEM_ATTN​

Nokia/Ericsson definition.

Declaration
OEM_ATTN = 240

OEM_FINISH​

Nokia/Ericsson definition.

Declaration
OEM_FINISH = 241

OEM_COPY​

Nokia/Ericsson definition.

Declaration
OEM_COPY = 242

OEM_AUTO​

Nokia/Ericsson definition.

Declaration
OEM_AUTO = 243

OEM_ENLW​

Nokia/Ericsson definition.

Declaration
OEM_ENLW = 244

OEM_BACKTAB​

Nokia/Ericsson definition.

Declaration
OEM_BACKTAB = 245

ATTN​

Attn key.

Declaration
ATTN = 246

CRSEL​

CrSel key.

Declaration
CRSEL = 247

EXSEL​

ExSel key.

Declaration
EXSEL = 248

EREOF​

Erase EOF key.

Declaration
EREOF = 249

PLAY​

Play key.

Declaration
PLAY = 250

ZOOM​

Zoom key.

Declaration
ZOOM = 251

NONAME​

Reserved constant by Windows headers definition.

Declaration
NONAME = 252

PA1​

PA1 key.

Declaration
PA1 = 253

OEM_CLEAR​

Clear key.

Declaration
OEM_CLEAR = 254

Extension Methods​