VB键盘常量大全256个虚拟键码

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

PublicConstVK_LBUTTON=&H1PublicConstVK_RBUTTON=&H2PublicConstVK_CANCEL=&H3PublicConstVK_MBUTTON=&H4PublicConstVK_BACK=&H8PublicConstVK_TAB=&H9PublicConstVK_CLEAR=&HCPublicConstVK_RETURN=&HDPublicConstVK_SHIFT=&H10PublicConstVK_CONTROL=&H11PublicConstVK_MENU=&H12PublicConstVK_PAUSE=&H13PublicConstVK_CAPITAL=&H14PublicConstVK_ESCAPE=&H1BPublicConstVK_SPACE=&H20PublicConstVK_PRIOR=&H21PublicConstVK_NEXT=&H22PublicConstVK_END=&H23PublicConstVK_HOME=&H24PublicConstVK_LEFT=&H25PublicConstVK_UP=&H26PublicConstVK_RIGHT=&H27PublicConstVK_DOWN=&H28PublicConstVK_Select=&H29PublicConstVK_PRINT=&H2APublicConstVK_EXECUTE=&H2BPublicConstVK_SNAPSHOT=&H2CPublicConstVK_Insert=&H2DPublicConstVK_Delete=&H2EPublicConstVK_HELP=&H2FPublicConstVK_0=&H30PublicConstVK_1=&H31PublicConstVK_2=&H32PublicConstVK_3=&H33PublicConstVK_4=&H34PublicConstVK_5=&H35PublicConstVK_6=&H36PublicConstVK_7=&H37PublicConstVK_8=&H38PublicConstVK_9=&H39PublicConstVK_A=&H41PublicConstVK_B=&H42PublicConstVK_C=&H43PublicConstVK_D=&H44PublicConstVK_E=&H45PublicConstVK_F=&H46PublicConstVK_G=&H47PublicConstVK_H=&H48PublicConstVK_I=&H49PublicConstVK_J=&H4APublicConstVK_K=&H4BPublicConstVK_L=&H4CPublicConstVK_M=&H4DPublicConstVK_N=&H4EPublicConstVK_O=&H4FPublicConstVK_P=&H50PublicConstVK_Q=&H51PublicConstVK_R=&H52PublicConstVK_S=&H53PublicConstVK_T=&H54PublicConstVK_U=&H55PublicConstVK_V=&H56PublicConstVK_W=&H57PublicConstVK_X=&H58PublicConstVK_Y=&H59PublicConstVK_Z=&H5APublicConstVK_STARTKEY=&H5BPublicConstVK_CONTEXTKEY=&H5DPublicConstVK_NUMPAD0=&H60PublicConstVK_NUMPAD1=&H61PublicConstVK_NUMPAD2=&H62PublicConstVK_NUMPAD3=&H63PublicConstVK_NUMPAD4=&H64PublicConstVK_NUMPAD5=&H65PublicConstVK_NUMPAD6=&H66PublicConstVK_NUMPAD7=&H67PublicConstVK_NUMPAD8=&H68PublicConstVK_NUMPAD9=&H69PublicConstVK_MULTIPLY=&H6APublicConstVK_ADD=&H6BPublicConstVK_SEPARATOR=&H6CPublicConstVK_SUBTRACT=&H6DPublicConstVK_DECIMAL=&H6EPublicConstVK_DIVIDE=&H6FPublicConstVK_F1=&H70PublicConstVK_F2=&H71PublicConstVK_F3=&H72PublicConstVK_F4=&H73PublicConstVK_F5=&H74PublicConstVK_F6=&H75PublicConstVK_F7=&H76PublicConstVK_F8=&H77PublicConstVK_F9=&H78PublicConstVK_F10=&H79PublicConstVK_F11=&H7APublicConstVK_F12=&H7BPublicConstVK_F13=&H7CPublicConstVK_F14=&H7DPublicConstVK_F15=&H7EPublicConstVK_F16=&H7FPublicConstVK_F17=&H80PublicConstVK_F18=&H81PublicConstVK_F19=&H82PublicConstVK_F20=&H83PublicConstVK_F21=&H84PublicConstVK_F22=&H85PublicConstVK_F23=&H86PublicConstVK_F24=&H87PublicConstVK_NUMLOCK=&H90PublicConstVK_OEM_SCROLL=&H91PublicConstVK_OEM_1=&HBAPublicConstVK_OEM_PLUS=&HBBPublicConstVK_OEM_COMMA=&HBCPublicConstVK_OEM_MINUS=&HBDPublicConstVK_OEM_PERIOD=&HBEPublicConstVK_OEM_2=&HBFPublicConstVK_OEM_3=&HC0PublicConstVK_OEM_4=&HDBPublicConstVK_OEM_5=&HDCPublicConstVK_OEM_6=&HDDPublicConstVK_OEM_7=&HDEPublicConstVK_OEM_8=&HDFPublicConstVK_ICO_F17=&HE0PublicConstVK_ICO_F18=&HE1PublicConstVK_OEM102=&HE2PublicConstVK_ICO_HELP=&HE3PublicConstVK_ICO_00=&HE4PublicConstVK_ICO_CLEAR=&HE6PublicConstVK_OEM_RESET=&HE9PublicConstVK_OEM_JUMP=&HEAPublicConstVK_OEM_PA1=&HEBPublicConstVK_OEM_PA2=&HECPublicConstVK_OEM_PA3=&HEDPublicConstVK_OEM_WSCTRL=&HEEPublicConstVK_OEM_CUSEL=&HEFPublicConstVK_OEM_ATTN=&HF0PublicConstVK_OEM_FINNISH=&HF1PublicConstVK_OEM_COPY=&HF2PublicConstVK_OEM_AUTO=&HF3PublicConstVK_OEM_ENLW=&HF4PublicConstVK_OEM_BACKTAB=&HF5PublicConstVK_ATTN=&HF6PublicConstVK_CRSEL=&HF7PublicConstVK_EXSEL=&HF8PublicConstVK_EREOF=&HF9PublicConstVK_PLAY=&HFAPublicConstVK_ZOOM=&HFBPublicConstVK_NONAME=&HFCPublicConstVK_PA1=&HFDPublicConstVK_OEM_CLEAR=&HFE虚拟键码虚拟键码保存在WM_KEYDOWN、WM_KEYUP、WM_SYSKEYDOWN和WM_SYSKEYUP讯息的wParam参数中。此代码标识按下或释放的键。哈,又是「虚拟」,您喜欢这个词吗?虚拟指的是假定存在於思想中而不是现实世界中的一些事物,也只有熟练使用DOS组合语言编写应用程式的程式写作者才有可能指出,为什么对Windows键盘处理如此基本的键码是虚拟的而不是真实的。对於早期的程式写作者来说,真实的键码由实际键盘硬体产生。在Windows文件中将这些键码称为「扫描码(scancodes)」。在IBM相容机种上,扫描码16是Q键,17是W键,18是E、19是R,20是T,21是Y等等。这时您会发现,扫描码是依据键盘的实际布局的。Windows开发者认为这些代码过於与设备相关了,於是他们试图通过定义所谓的虚拟键码,以便经由与装置无关的方式处理键盘。其中一些虚拟键码不能在IBM相容机种上产生,但可能会在其他制造商生产的键盘中找到,或者在未来的键盘上找到。您使用的大多数虚拟键码的名称在WINUSER.H表头档案中都定义为以VK_开头。表6-2列出了这些名称和数值(十进位和十六进位),以及与虚拟键相对应的IBM相容机种键盘上的键。下表也标出了Windows执行时是否需要这些键。下表还按数位顺序列出了虚拟键码。前四个虚拟键码中有三个指的是滑鼠键:表6-2十进位十六进位WINUSER.H识别字必需?IBM相容键盘101VK_LBUTTON滑鼠左键202VK_RBUTTON滑鼠右键303VK_CANCELˇCtrl-Break404VK_MBUTTON滑鼠中键您永远都不会从键盘讯息中获得这些滑鼠键代码。在下一章可以看到,我们能够从滑鼠讯息中获得它们。VK_CANCEL代码是一个虚拟键码,它包括同时按下两个键(Ctrl-Break)。Windows应用程式通常不使用此键。表6-3中的键--Backspace、Tab、Enter、Escape和Spacebar-通常用於Windows程式。不过,Windows一般用字元讯息(而不是键盘讯息)来处理这些键。表6-3十进位十六进位WINUSER.H识别字必需?IBM相容键盘808VK_BACKˇBackspace909VK_TABˇTab120CVK_CLEARNumLock关闭时的数字键盘5130DVK_RETURNˇEnter(或者另一个)1610VK_SHIFTˇShift(或者另一个)1711VK_CONTROLˇCtrl(或者另一个)1812VK_MENUˇAlt(或者另一个)1913VK_PAUSEPause2014VK_CAPITALˇCapsLock271BVK_ESCAPEˇEsc3220VK_SPACEˇSpacebar另外,Windows程式通常不需要监视Shift、Ctrl或Alt键的状态。表6-4列出的前八个码可能是与VK_INSERT和VK_DELETE一起最常用的虚拟键码:表6-4十进位十六进位WINUSER.H识别字必需?IBM相容键盘3321VK_PRIORˇPageUp3422VK_NEXTˇPageDown3523VK_ENDˇEnd3624VK_HOMEˇHome3725VK_LEFTˇ左箭头3826VK_UPˇ上箭头3927VK_RIGHTˇ右箭头4028VK_DOWNˇ下箭头4129VK_SELECT422AVK_PRINT432BVK_EXECUTE442CVK_SNAPSHOTPrintScreen452DVK_INSER

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功