Keyboard codes
top keyboard row: escape key and function keys | |||||
| keytop |
| ||||
| esc | esc,0x1b | ||||
| f1 | esc,0x1b | [,0x5b | 1,0x31 | 1,0x31 | ~,0x7e |
| f2 | esc,0x1b | [,0x5b | 1,0x31 | 2,0x32 | ~,0x7e |
| f3 | esc,0x1b | [,0x5b | 1,0x31 | 3,0x33 | ~,0x7e |
| f4 | esc,0x1b | [,0x5b | 1,0x31 | 4,0x34 | ~,0x7e |
| f5 | esc,0x1b | [,0x5b | 1,0x31 | 5,0x35 | ~,0x7e |
| f6 | esc,0x1b | [,0x5b | 1,0x31 | 7,0x37 | ~,0x7e |
| f7 | esc,0x1b | [,0x5b | 1,0x31 | 8,0x38 | ~,0x7e |
| f8 | esc,0x1b | [,0x5b | 1,0x31 | 9,0x39 | ~,0x7e |
| f9 | esc,0x1b | [,0x5b | 2,0x32 | 0,0x30 | ~,0x7e |
| f10 | esc,0x1b | [,0x5b | 2,0x32 | 1,0x31 | ~,0x7e |
| f11 | esc,0x1b | [,0x5b | 2,0x32 | 3,0x33 | ~,0x7e |
| f12 | esc,0x1b | [,0x5b | 2,0x32 | 4,0x34 | ~,0x7e |
cursor-control pad | |||||
| keytop |
| ||||
| left arrow | esc,0x1b | [,0x5b | D,0x44 | ||
| up arrow | esc,0x1b | [,0x5b | A,0x41 | ||
| right arrow | esc,0x1b | [,0x5b | C,0x43 | ||
| down arrow | esc,0x1b | [,0x5b | B,0x42 | ||
| delete | esc,0x1b | [,0x5b | 3,0x33 | ~,0x7e | |
| end | esc,0x1b | [,0x5b | 4,0x34 | ~,0x7e | |
| page down | esc,0x1b | [,0x5b | 6,0x36 | ~,0x7e | |
| insert | esc,0x1b | [,0x5b | 2,0x32 | ~,0x7e | |
| home | esc,0x1b | [,0x5b | 1,0x31 | ~,0x7e | |
| page up | esc,0x1b | [,0x5b | 5,0x35 | ~,0x7e | |
| print scrn | no code transmitted | ||||
| scroll lock | no code transmitted | ||||
| pause/break | (graphic?),0x1a | ||||
numeric pad, numlock OFF | |||||
| keytop |
| ||||
| 0/ins | esc,0x1b | [,0x5b | 2,0x32 | ~,0x7e | |
| ./del | esc,0x1b | [,0x5b | 3,0x33 | ~,0x7e | |
| 1/end | esc,0x1b | [,0x5b | 4,0x34 | ~,0x7e | |
| 2 | esc,0x1b | [,0x5b | B,0x42 | ||
| 3/pg-dn | esc,0x1b | [,0x5b | 6,0x36 | ~,0x7e | |
| 4 | esc,0x1b | [,0x5b | D,0x44 | ||
| 5 | esc,0x1b | [,0x5b | G,0x47 | ||
| 6 | esc,0x1b | [,0x5b | C,0x43 | ||
| 7/home | esc,0x1b | [,0x5b | 1,0x31 | ~,0x7e | |
| 8 | esc,0x1b | [,0x5b | A,0x41 | ||
| 9/pg-up | esc,0x1b | [,0x5b | 5,0x35 | ~,0x7e | |
| numlock | no code transmitted | ||||
| virgule | /,0x2f | ||||
| * | *,0x2a | ||||
| - | -,0x2d | ||||
| + | +,0x2b | ||||
| enter | cr,0xd | ||||
====
http://www.pwilson.net/kbhit_notes.html
本文详尽地列举了键盘上的各种键及其对应的ASCII码和十六进制码,包括从基本键到控制面板的所有功能键,如方向键、删除、结束等,并详细解释了每个键的功能及编码方式。
3041

被折叠的 条评论
为什么被折叠?



