符号的数值表示,比如回车用#13表示 白拿分,快来(50分)

  • 主题发起人 主题发起人 wuhee1
  • 开始时间 开始时间
W

wuhee1

Unregistered / Unconfirmed
GUEST, unregistred user!
记得以前在网上看到过一篇文章,列举了所有符号的数值表示,比如回车用#13表示,
Tab用#9表示,不知那位高手告诉我可以下载的地方。谢谢
 
这是ASCII码啊,很奇怪任何一本汇编或PASCAL教材里都有啊
 
找一找ASCII码表就可以了。
另外,在程序中,尽量不要用#13,#9之类的符号,那样的程序不容易读懂
 
不然写个小程序也很容易
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
showmessage(inttostr(key));
end;
这样你可以通过它知道一些特殊键的数值
 
我同意fastest2000的办法。。。
 
其实就是ASCII吗对照表,‘#’代表将后面的数字转化为相应的ASCII吗!而13,9等ASCII吗
值代表的是控制字符,所以会触发相应的动作!相信这不难找,其实如果你只是想要键值对应
的话不如使用虚拟键值,如回车是VK_RETURN,简便易懂!下面给你贴一份!


VK_0 through VK_9 are the same as ASCII "0" through "9" (0x30 - 0x39).
VK_1
A virtual key code for the ASCII "1" key.
VK_2
A virtual key code for the ASCII "2" key.
VK_3
A virtual key code for the ASCII "3" key.
VK_4
A virtual key code for the ASCII "4" key.
VK_5
A virtual key code for the ASCII "5" key.
VK_6
A virtual key code for the ASCII "6" key.
VK_7
A virtual key code for the ASCII "7" key.
VK_8
A virtual key code for the ASCII "8" key.
VK_9
A virtual key code for the ASCII "9" key.
VK_A
VK_A through VK_Z are the same as ASCII "A" through "Z" (0x41 - 0x5A).
VK_ACCEPT
For Asian keyboards.
VK_ADD
A virtual key code for the numeric keypad PLUS SIGN (+) key.
VK_ALT
A virtual key code for the ALT key.
VK_B
A virtual key code for the ASCII "B" key.
VK_BACK_QUOTE
A virtual key code for the apostrophe (`) key.
VK_BACK_SLASH
A virtual key code for the BACKSLASH (/) key.
VK_BACK_SPACE
A virtual key code for the BACKSPACE key.
VK_C
A virtual key code for the ASCII "C" key.
VK_CANCEL
A virtual key code for the CANCEL key.
VK_CAPS_LOCK
A virtual key code for the CAPS LOCK key.
VK_CLEAR
A virtual key code for the CLEAR key.
VK_CLOSE_BRACKET
A virtual key code for the CLOSE BRACKET (]) key.
VK_COMMA
A virtual key code for the COMMA (,) key.
VK_CONTROL
A virtual key code for the CTRL key.
VK_CONVERT
For Asian keyboards.
VK_D
A virtual key code for the ASCII "D" key.
VK_DECIMAL
A virtual key code for the numeric keypad DECIMAL POINT (.) key.
VK_DELETE
A virtual key code for the DELETE key.
VK_DIVIDE
A virtual key code for the numeric keypad DIVISION (/) key.
VK_DOWN
A virtual key code for the DOWN ARROW key.
VK_E
A virtual key code for the ASCII "E" key.
VK_END
A virtual key code for the END key.
VK_ENTER
A virtual key code for the ENTER key.
VK_EQUALS
A virtual key code for the EQUAL SIGN (=) key.
VK_ESCAPE
A virtual key code for the ESC key.
VK_F
A virtual key code for the ASCII "F" key.
VK_F1
A virtual key code for the F1 key.
VK_F10
A virtual key code for the F10 key.
VK_F11
A virtual key code for the F11 key.
VK_F12
A virtual key code for the F12 key.
VK_F2
A virtual key code for the F2 key.
VK_F3
A virtual key code for the F3 key.
VK_F4
A virtual key code for the F4 key.
VK_F5
A virtual key code for the F5 key.
VK_F6
A virtual key code for the F6 key.
VK_F7
A virtual key code for the F7 key.
VK_F8
A virtual key code for the F8 key.
VK_F9
A virtual key code for the F9 key.
VK_FINAL
For Asian keyboards.
VK_G
A virtual key code for the ASCII "G" key.
VK_H
A virtual key code for the ASCII "H" key.
VK_HELP
A virtual key code for the HELP key.
VK_HOME
A virtual key code for the HOME key.
VK_I
A virtual key code for the ASCII "I" key.
VK_INSERT
A virtual key code for the INSERT key.
VK_J
A virtual key code for the ASCII "J" key.
VK_K
A virtual key code for the ASCII "K" key.
VK_KANA
For Asian keyboards.
VK_KANJI
For Asian keyboards.
VK_L
A virtual key code for the ASCII "L" key.
VK_LEFT
A virtual key code for the LEFT ARROW key.
VK_M
A virtual key code for the ASCII "M" key.
VK_META
A virtual key code for the Application key (found on Microsoft® Windows® 95 keyboards).
VK_MODECHANGE
For Asian keyboards.
VK_MULTIPLY
A virtual key code for the numeric keypad MULTIPLICATION (*) key.
VK_N
A virtual key code for the ASCII "N" key.
VK_NONCONVERT
For Asian keyboards.
VK_NUM_LOCK
A virtual key code for the NUM LOCK key.
VK_NUMPAD0
A virtual key code for the numeric keypad "0" key.
VK_NUMPAD1
A virtual key code for the numeric keypad "1" key.
VK_NUMPAD2
A virtual key code for the numeric keypad "2" key.
VK_NUMPAD3
A virtual key code for the numeric keypad "3" key.
VK_NUMPAD4
A virtual key code for the numeric keypad "4" key.
VK_NUMPAD5
A virtual key code for the numeric keypad "5" key.
VK_NUMPAD6
A virtual key code for the numeric keypad "6" key.
VK_NUMPAD7
A virtual key code for the numeric keypad "7" key.
VK_NUMPAD8
A virtual key code for the numeric keypad "8" key.
VK_NUMPAD9
A virtual key code for the numeric keypad "9" key.
VK_O
A virtual key code for the ASCII "O" key.
VK_OPEN_BRACKET
A virtual key code for the OPEN BRACKET ([) key.
VK_P
A virtual key code for the ASCII "P" key.
VK_PAGE_DOWN
A virtual key code for the PAGE DOWN key.
VK_PAGE_UP
A virtual key code for the PAGE UP key.
VK_PAUSE
A virtual key code for the PAUSE (BREAK) key.
VK_PERIOD
A virtual key code for the PERIOD (.) key.
VK_PRINTSCREEN
A virtual key code for the PRINT SCREEN key.
VK_Q
A virtual key code for the ASCII "Q" key.
VK_QUOTE
A virtual key code for the QUOTATION MARK key.
VK_R
A virtual key code for the ASCII "R" key.
VK_RIGHT
A virtual key code for the RIGHT ARROW key.
VK_S
A virtual key code for the ASCII "S" key.
VK_SCROLL_LOCK
A virtual key code for the SCROLL LOCK key.
VK_SEMICOLON
A virtual key code for the SEMICOLON (;) key.
VK_SEPARATER
VK_SHIFT
A virtual key code for the SHIFT key.
VK_SLASH
A virtual key code for the forward slash (/) key.
VK_SPACE
A virtual key code for the SPACEBAR key.
VK_SUBTRACT
A virtual key code for the numeric keypad MINUS SIGN (-) key.
VK_T
A virtual key code for the ASCII "T" key.
VK_TAB
A virtual key code for the TAB key.
VK_U
A virtual key code for the ASCII "U" key.
VK_UNDEFINED
KEY_TYPED events do not have a defined key code.
VK_UP
A virtual key code for the UP ARROW key.
VK_V
A virtual key code for the ASCII "V" key.
VK_W
A virtual key code for the ASCII "W" key.
VK_X
A virtual key code for the ASCII "X" key.
VK_Y
A virtual key code for the ASCII "Y" key.
VK_Z
A virtual key code for the ASCII "Z" key.
 
其实,只要机器上装有Delphi的,就有所有的按键代码。方法是用写字板打开Window.pas。
查找'VK_',就可以了。简单吧!
仔细看一看Window.pas,还会有许多意想不到的结果。
什么?!不知道Window.pas在哪里。它就在../Borland/Delphi5/Source/VCL/Window.pas
 
../Borland/Delphi5/Source/VCL/Window.pas

Virtual-Key Codes/ Symbolic constant name/ Value (hexadecimal)
Name Value Mouse or keyboard equivalent
VK_LBUTTON 01 Left mouse button
VK_RBUTTON 02 Right mouse button
VK_CANCEL 03 Control-break processing
VK_MBUTTON 04 Middle mouse button (three-button mouse)
? 05-07 Undefined
VK_BACK 08 BACKSPACE key
VK_TAB 09 TAB key
? 0A-0B Undefined
VK_CLEAR 0C CLEAR key
VK_RETURN 0D ENTER key
? 0E-0F Undefined
VK_SHIFT 10 SHIFT key
VK_CONTROL 11 CTRL key
VK_MENU 12 ALT key
VK_PAUSE 13 PAUSE key
VK_CAPITAL 14 CAPS LOCK key
? 15-19 Reserved for Kanji systems
? 1A Undefined
VK_ESCAPE 1B ESC key
? 1C-1F Reserved for Kanji systems
VK_SPACE 20 SPACEBAR
VK_PRIOR 21 PAGE UP key
VK_NEXT 22 PAGE DOWN key
VK_END 23 END key
VK_HOME 24 HOME key
VK_LEFT 25 LEFT ARROW key
VK_UP 26 UP ARROW key
VK_RIGHT 27 RIGHT ARROW key
VK_DOWN 28 DOWN ARROW key
VK_SELECT 29 SELECT key
? 2A Original equipment manufacturer (OEM) specific
VK_EXECUTE 2B EXECUTE key
VK_SNAPSHOT 2C PRINT SCREEN key for Windows 3.0 and later
VK_INSERT 2D INS key
VK_DELETE 2E DEL key
VK_HELP 2F HELP key
VK_0 30 0 key
VK_9 39 9 key
? 3A-40 Undefined
VK_A 41 A key
VK_Z 5A Z key
VK_LWIN 5B Left Windows key (Microsoft Natural Keyboard)
VK_RWIN 5C Right Windows key (Microsoft Natural Keyboard)
VK_APPS 5D Applications key (Microsoft Natural Keyboard)
? 5E-5F Undefined
VK_NUMPAD0 60 Numeric keypad 0 key
VK_NUMPAD9 69 Numeric keypad 9 key
VK_MULTIPLY 6A Multiply key
VK_ADD 6B Add key
VK_SEPARATOR 6C Separator key
VK_SUBTRACT 6D Subtract key
VK_DECIMAL 6E Decimal key
VK_DIVIDE 6F Divide key
VK_F1 70 F1 key
VK_F24 87H F24 key
? 88-8F Unassigned
VK_NUMLOCK 90 NUM LOCK key
VK_SCROLL 91 SCROLL LOCK key
? 92-B9 Unassigned
? BA-C0 OEM specific
? C1-DA Unassigned
? DB-E4 OEM specific
? E5 Unassigned
? E6 OEM specific
? E7-E8 Unassigned
? E9-F5 OEM specific
VK_ATTN F6 Attn key
VK_CRSEL F7 CrSel key
VK_EXSEL F8 ExSel key
VK_EREOF F9 Erase EOF key
VK_PLAY FA Play key
VK_ZOOM FB Zoom key
VK_NONAME FC Reserved for future use.
VK_PA1 FD PA1 key
VK_OEM_CLEAR FE Clear key
 
你可以查一下源码,忘了是哪个.pas文件
 
VK_很好呀,ascii码表在小学的basic书后面都有
 
接受答案了.
 
后退
顶部