Chareon
06-25-2005, 03:56 PM
Took me a while, but I managed to make a list of as many of the keycodes and names for the various keys on the keyboard. Their used in Javascript when dealing with keyboard functions(ex: onkey or downkey events). The keys are next to their keycodes. Hope this helps those of you who are learning/using java who've been having trouble with these :D
The Key Names
VK_TAB - Tab key
VK_CLEAR -Clear key
VK_RETURN -Enter key
VK_SHIFT -Shift key
VK_CONTROL - Ctrl key
VK_MENU -Alt key
VK_PAUSE -Pause key
VK_CAPITAL - Caps Lock key
VK_ESCAPE -Esc key
VK_LBUTTON -Left mouse button
VK_RBUTTON -Right mouse button
VK_CANCEL - Control+Break
VK_MBUTTON - Middle mouse button
VK_BACK - Backspace key
VK_SPACE - Space bar
VK_PRIOR - Page Up key
VK_NEXT - Page Down key
VK_END -End key
VK_HOME - Home key
VK_LEFT - Left Arrow key
VK_UP - Up Arrow key
VK_RIGHT - Right Arrow key
VK_DOWN - Down Arrow key
VK_SNAPSHOT - Print Screen key
VK_INSERT - Insert key
VK_DELETE -Delete key
VK_NUMPAD0 - 0 key (numberpad)
VK_NUMPAD1 -1 key (numberpad)
VK_NUMPAD2 - 2 key (numberpad)
VK_NUMPAD3 -3 key (numberpad)
VK_NUMPAD4 -4 key (numberpad)
VK_NUMPAD5 -5 key (numberpad)
VK_NUMPAD6 -6 key (numberpad)
VK_NUMPAD7 -7 key (numberpad)
VK_NUMPAD8 -8 key (numberpad)
VK_NUMPAD9 -9 key (numberpad)
VK_MULTIPLY -* (numberpad)
VK_ADD - + (numberpad)
VK_SEPARATOR - | (numberpad)
VK_SUBTRACT - - (numberpad)
VK_DECIMAL - . (numberpad)
VK_DIVIDE - / (numberpad)
VK_NUMLOCK - Num Lock key
VK_SCROLL - Scroll Lock key
VK_F1 - F1 key
VK_F2 -F2 key
VK_F3 -F3 key
VK_F4 - F4 key
VK_F5 - F5 key
VK_F6 -F6 key
VK_F7 -F7 key
VK_F8 -F8 key
VK_F9 -F9 key
VK_F10 - F10 key
VK_F11 - F11 key
VK_F12 - F12 key
VK_F13 - F13 key
VK_F14 - F14 key
VK_F15 - F15 key
VK_F16 - F16 key
VK_F17 F17 key
VK_F18 - F18 key
VK_F19 - F19 key
VK_F20 - F20 key
VK_F21 - F21 key
VK_F22 - F22 key
VK_F23 - F23 key
VK_F24 - F24 key
Keys/ Keycodes
BackSpace 8
Tab 9
Return / Enter 13
Shift 16
Ctrl 17
Alt 18
Pause / Break 19
CapsLock 20
Esc 27
Space 32
Page Up 33
Page Down 34
End 35
Home 36
LeftArrow 37
UpArrow 38
RightArrow 39
DownArrow 40
PrintScreen / SysRq 44
Insert 45
Delete 46
[0] 48
[1] 49
[2] 50
[3] 51
[4] 52
[5] 53
[6] 54
[7] 55
[8] 56
[9] 57
[A] 65
[B] 66
[C] 67
[D] 68
[E] 69
[F] 70
[G] 71
[H] 72
[I] 73
[J] 74
[K] 75
[L] 76
[M] 77
[N] 78
[O] 79
[P] 80
[Q] 81
[R] 82
[S] 83
[T] 84
[U] 85
[V] 86
[W] 87
[X] 88
[Y] 89
[Z] 90
[NumberPad 0] 96
[NumberPad 1] 97
[NumberPad 2] 98
[NumberPad 3] 99
[NumberPad 4] 100
[NumberPad 5] 101
[NumberPad 6] 102
[NumberPad 7] 103
[NumberPad 8] 104
[NumberPad 9] 105
[NumberPad *] 106
[NumberPad +] 107
[NumberPad -] 109
[NumberPad ,] 110
[NumberPad /] 111
[F1] 112
[F2] 113
[F3] 114
[F4] 115
[F5] 116
[F6] 117
[F7] 118
[F8] 119
[F9] 120
[F10] 121
[F11] 122
[F12] 123
NumLock 144
ScrollLock 145
(0) 48
(1) 49
(2) 50
(3) 51
(4) 52
(5) 53
(6) 54
(7) 55
(8) 56
(9) 57
! 33
" 34
# 35
$ 36
% 37
& 38
' 39
( 40
) 41
* 42
+ 43
, 44
- 45
. 46
/ 47
: 58
; 59
< 60
= 61
> 62
? 63
@ 64
[ 91
\ 92
] 93
^ 94
_ 95
` 96
(a) 97
(b) 98
(c) 99
(d) 100
(e) 101
(f) 102
(g) 103
(h) 104
(i) 105
(j) 106
(k) 107
(l) 108
(m) 109
(n) 110
(o) 111
(p) 112
(q) 113
(r) 114
(s) 115
(t) 116
(u) 117
(v) 118
(w) 119
(x) 120
(y) 121
(z) 122
{ 123
| 124
} 125
~ 126
If you spot any mistakes, or see some that I forgot, don't neglect to pont them out.
The Key Names
VK_TAB - Tab key
VK_CLEAR -Clear key
VK_RETURN -Enter key
VK_SHIFT -Shift key
VK_CONTROL - Ctrl key
VK_MENU -Alt key
VK_PAUSE -Pause key
VK_CAPITAL - Caps Lock key
VK_ESCAPE -Esc key
VK_LBUTTON -Left mouse button
VK_RBUTTON -Right mouse button
VK_CANCEL - Control+Break
VK_MBUTTON - Middle mouse button
VK_BACK - Backspace key
VK_SPACE - Space bar
VK_PRIOR - Page Up key
VK_NEXT - Page Down key
VK_END -End key
VK_HOME - Home key
VK_LEFT - Left Arrow key
VK_UP - Up Arrow key
VK_RIGHT - Right Arrow key
VK_DOWN - Down Arrow key
VK_SNAPSHOT - Print Screen key
VK_INSERT - Insert key
VK_DELETE -Delete key
VK_NUMPAD0 - 0 key (numberpad)
VK_NUMPAD1 -1 key (numberpad)
VK_NUMPAD2 - 2 key (numberpad)
VK_NUMPAD3 -3 key (numberpad)
VK_NUMPAD4 -4 key (numberpad)
VK_NUMPAD5 -5 key (numberpad)
VK_NUMPAD6 -6 key (numberpad)
VK_NUMPAD7 -7 key (numberpad)
VK_NUMPAD8 -8 key (numberpad)
VK_NUMPAD9 -9 key (numberpad)
VK_MULTIPLY -* (numberpad)
VK_ADD - + (numberpad)
VK_SEPARATOR - | (numberpad)
VK_SUBTRACT - - (numberpad)
VK_DECIMAL - . (numberpad)
VK_DIVIDE - / (numberpad)
VK_NUMLOCK - Num Lock key
VK_SCROLL - Scroll Lock key
VK_F1 - F1 key
VK_F2 -F2 key
VK_F3 -F3 key
VK_F4 - F4 key
VK_F5 - F5 key
VK_F6 -F6 key
VK_F7 -F7 key
VK_F8 -F8 key
VK_F9 -F9 key
VK_F10 - F10 key
VK_F11 - F11 key
VK_F12 - F12 key
VK_F13 - F13 key
VK_F14 - F14 key
VK_F15 - F15 key
VK_F16 - F16 key
VK_F17 F17 key
VK_F18 - F18 key
VK_F19 - F19 key
VK_F20 - F20 key
VK_F21 - F21 key
VK_F22 - F22 key
VK_F23 - F23 key
VK_F24 - F24 key
Keys/ Keycodes
BackSpace 8
Tab 9
Return / Enter 13
Shift 16
Ctrl 17
Alt 18
Pause / Break 19
CapsLock 20
Esc 27
Space 32
Page Up 33
Page Down 34
End 35
Home 36
LeftArrow 37
UpArrow 38
RightArrow 39
DownArrow 40
PrintScreen / SysRq 44
Insert 45
Delete 46
[0] 48
[1] 49
[2] 50
[3] 51
[4] 52
[5] 53
[6] 54
[7] 55
[8] 56
[9] 57
[A] 65
[B] 66
[C] 67
[D] 68
[E] 69
[F] 70
[G] 71
[H] 72
[I] 73
[J] 74
[K] 75
[L] 76
[M] 77
[N] 78
[O] 79
[P] 80
[Q] 81
[R] 82
[S] 83
[T] 84
[U] 85
[V] 86
[W] 87
[X] 88
[Y] 89
[Z] 90
[NumberPad 0] 96
[NumberPad 1] 97
[NumberPad 2] 98
[NumberPad 3] 99
[NumberPad 4] 100
[NumberPad 5] 101
[NumberPad 6] 102
[NumberPad 7] 103
[NumberPad 8] 104
[NumberPad 9] 105
[NumberPad *] 106
[NumberPad +] 107
[NumberPad -] 109
[NumberPad ,] 110
[NumberPad /] 111
[F1] 112
[F2] 113
[F3] 114
[F4] 115
[F5] 116
[F6] 117
[F7] 118
[F8] 119
[F9] 120
[F10] 121
[F11] 122
[F12] 123
NumLock 144
ScrollLock 145
(0) 48
(1) 49
(2) 50
(3) 51
(4) 52
(5) 53
(6) 54
(7) 55
(8) 56
(9) 57
! 33
" 34
# 35
$ 36
% 37
& 38
' 39
( 40
) 41
* 42
+ 43
, 44
- 45
. 46
/ 47
: 58
; 59
< 60
= 61
> 62
? 63
@ 64
[ 91
\ 92
] 93
^ 94
_ 95
` 96
(a) 97
(b) 98
(c) 99
(d) 100
(e) 101
(f) 102
(g) 103
(h) 104
(i) 105
(j) 106
(k) 107
(l) 108
(m) 109
(n) 110
(o) 111
(p) 112
(q) 113
(r) 114
(s) 115
(t) 116
(u) 117
(v) 118
(w) 119
(x) 120
(y) 121
(z) 122
{ 123
| 124
} 125
~ 126
If you spot any mistakes, or see some that I forgot, don't neglect to pont them out.