求键盘每个键对应的数值?

fyz21cn 2003-07-16 09:11:43
各位,我现在已经知道回车键对应的数值为13。其他的键对应的值又是什么呢?
请指教。
...全文
208 24 打赏 收藏 转发到动态 举报
写回复
用AI写文章
24 条回复
切换为时间正序
请发表友善的回复…
发表回复
bhut 2003-07-16
  • 打赏
  • 举报
回复
已发送
fyz21cn 2003-07-16
  • 打赏
  • 举报
回复
我的信箱是
fyz21cncsdn@yahoo.com.cn

谢谢。
jackie168 2003-07-16
  • 打赏
  • 举报
回复
TO:樓主
   已發送,請查收CSDN的消息。
jackie168 2003-07-16
  • 打赏
  • 举报
回复
我之前有寫過一個這樣的小程序,偶去找找看...........
sensory 2003-07-16
  • 打赏
  • 举报
回复
sensory@163.com
我要一个
3x
bhut 2003-07-16
  • 打赏
  • 举报
回复
或者发到你信箱
bhut 2003-07-16
  • 打赏
  • 举报
回复
msdn作的比较绝,把这张表作成图片,没法拷贝了,或者你给一个网址我把这张图上传过去
bhut 2003-07-16
  • 打赏
  • 举报
回复
VK_0
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.
fyz21cn 2003-07-16
  • 打赏
  • 举报
回复
我没有MSDN,您是否可以帖出来?谢谢。
bhut 2003-07-16
  • 打赏
  • 举报
回复
用vc的msdn查ASCII Character Codes
有完整的表格
fyz21cn 2003-07-16
  • 打赏
  • 举报
回复
jackie168(玉面書生)提出的方法对于按F1等功能键就弹不出数值。这是为什么?

而且,现在我也搞不清楚,是不是键值就是说每一个键对应的值,而不是说该键能够打出几个不同的符号就对应几个不同的键值?

应该是这样,有经验的各位说一两句吧,谢谢。
cnhgj 2003-07-16
  • 打赏
  • 举报
回复
呜呜。。
jackie168 2003-07-16
  • 打赏
  • 举报
回复
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
showmessage(inttostr(ord(key)));
end;
fyz21cn 2003-07-16
  • 打赏
  • 举报
回复
难道就没有人知道是否A 和 a同值吗?我个人认为是该方法出错了。请指教
fyz21cn 2003-07-16
  • 打赏
  • 举报
回复
大哥,不行呀。
showmessage(pchar(intTostr(Integer(Key))));

当我这样做时,A 和 a显示的都是65,是不是key键不分大小写?
请继续指教。
超级大笨狼 2003-07-16
  • 打赏
  • 举报
回复
fengyizu(简单do) ( ) 信誉:100 2003-7-16 9:25:36 得分:0
我告诉你一个办法,新建立一个应用程序,上面放一个EDIT,在ONKEYDOWN事件中写
showmessage(pchar(intTostr(Integer(Key))));



honkily 2003-07-16
  • 打赏
  • 举报
回复
呵呵
duduwolf 2003-07-16
  • 打赏
  • 举报
回复
faint,一楼的好直接,全部贴出,断了后面兄弟的财路啦!
tellyes 2003-07-16
  • 打赏
  • 举报
回复
var
Form1: TForm1;
i:integer;
implementation

{$R *.dfm}




procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
i:=key;
end;


procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
memo1.Lines.Add(edit1.Text+': '+inttostr(i));
edit1.Text:='';
edit1.SetFocus;
end;
shang53 2003-07-16
  • 打赏
  • 举报
回复
http://dgr.twbts.com/delphi/?class=key1
加载更多回复(4)

5,930

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧