Sean's Personal Code Samples And References

Keycode Reference

Below is a table of key codes.
If this table is inconsistent with your own findings, please let me know.

Tryit for yourself.

Put your cursor in the box and press a key.

(The code for this textbox is at the bottom of this page.)


0  10  20Caps Lock 30  40Arrow Down
1  11  21  31  41 
2  12  22  32  42 
3  13Enter 23  33Page Up 43 
4  14  24  34Page Down 44 
5  15  25  35End 45Insert
6  16Shift 26  36Home 46Delete
7  17Ctrl 27Esc 37Arrow Left 47 
8Backspace 18Alt 28  38Arrow Up 480
9Tab 19Pause/Break 29  39Arrow Right 491
 
502 60  70f 80p 90z
513 61=+ 71g 81q 91Windows
524 62  72h 82r 92 
535 63  73i 83s 93Right Click
546 64  74j 84t 94 
557 65a 75k 85u 95 
568 66b 76l 86v 960 (Num Lock)
579 67c 77m 87w 971 (Num Lock)
58  68d 78n 88x 982 (Num Lock)
59;: 69e 79o 89y 993 (Num Lock)
 
1004 (Num Lock) 110. (Num Lock) 120F9 130  140 
1015 (Num Lock) 111/ (Num Lock) 121F10 131  141 
1026 (Num Lock) 112F1 122F11 132  142 
1037 (Num Lock) 113F2 123F12 133  143 
1048 (Num Lock) 114F3 124  134  144Num Lock
1059 (Num Lock) 115F4 125  135  145Scroll Lock
106* (Num Lock) 116F5 126  136  146 
107+ (Num Lock) 117F6 127  137  147 
108  118F7 128  138  148 
109- (Num Lock) 119F8 129  139  149 
 
150  160  170  180  190.>
151  161  171  181  191/?
152  162  172  182My Computer 192`~
153  163  173  183My Calculator 193 
154  164  174  184  194 
155  165  175  185  195 
156  166  176  186  196 
157  167  177  187  197 
158  168  178  188,< 198 
159  169  179  189  199 
 
200  210  220\| 230  240 
201  211  221]} 231  241 
202  212  222'" 232  242 
203  213  223  233  243 
204  214  224  234  244 
205  215  225  235  245 
206  216  226  236  246 
207  217  227  227  227 
208  218  228  238  248 
209  219[{ 229  239  249 
Example Textbox

<input type="text" name="txtExample" id="txtExample" onkeyup="AlertKeycode(event);" />
Javascript Code

<script type="text/javascript">
function AlertKeycode(evnt){

	var key = evnt.keyCode? evnt.keyCode : evnt.charCode;
	alert(key);
	
}
</script>
Sean Marcellus
There are 10 kinds of people e in this world, those who understand binary and those who don’t.