Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2161232
  • 博文数量: 361
  • 博客积分: 10828
  • 博客等级: 上将
  • 技术积分: 4161
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-20 14:34
文章分类

全部博文(361)

文章存档

2011年(132)

2010年(229)

分类: C/C++

2010-08-19 17:29:48

内容:模拟win键:
keybd_event(VK_LWIN, 0, 0, 0);
keybd_event(Byte('R'), 0, 0, 0);
keybd_event(Byte('R'), 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);

键盘常用代码一览表:
vbKeyLButton 0x1 鼠标左键
vbKeyRButton 0x2 鼠标右键
vbKeyCancel 0x3 CANCEL键
vbKeyMButton 0x4 鼠标中键
vbKeyBack 0x8 退格键
vbKeyTab 0x9 TAB 键
vbKeyClear 0xC CLEAR健
vbKeyReturn 0xD 回车键
vbKeyShift 0x10 SHIFT 键
vbKeyControl 0x11 CTRL 键
vbKeyMenu 0x12 MENU 键
vbKeyPause 0x13 PAUSE 键
vbKeyCapital 0x14 APS LOCK 键
vbKeyEscape 0x1B ESC 键
vbKeySpace 0x20 空格键
vbKeyPageUp 0x21 Page Up 键
vbKeyPageDown 0x22 Page Down 键
vbKeyEnd 0x23 END 键
vbKeyHome 0x24 HOME 键
vbKeyLeft 0x25 光标左键
vbKeyUp 0x26 光标上键
vbKeyRight 0x27 光标右键
vbKeyDown 0x28 光标下键
vbKeySelect 0x29 SELECT 键
vbKeyPrint 0x2A Print Screen 键
vbKeyExecute 0x2B EXECUTE 键
vbKeySnapshot 0x2C SnapShot 键
vbKeyInsert 0x2D INSERT 键
vbKeyDelete 0x2E DELETE 键
vbKeyHelp 0x2F HELP 键
vbKeyNumlock 0x90 NUM LOCK 键
vbKeyA 65 字母 A 键
vbKeyB 66 字母 B 键
vbKeyC 67 字母 C 键
vbKeyD 68 字母 D 键
vbKeyE 69 字母 E 键
vbKeyF 70 字母 F 键
vbKeyG 71 字母 G 键
vbKeyH 72 字母 H 键
vbKeyI 73 字母 I 键
vbKeyJ 74 字母 J 键
vbKeyK 75 字母 K 键
vbKeyL 76 字母 L 键
vbKeyM 77 字母 M 键
vbKeyN 78 字母 N 键
vbKeyO 79 字母 O 键
vbKeyP 80 字母 P 键
vbKeyQ 81 字母 Q 键
vbKeyR 82 字母 R 键
vbKeyS 83 字母 S 键
vbKeyT 84 字母 T 键
vbKeyU 85 字母 U 键
vbKeyV 86 字母 V 键
vbKeyW 87 字母 W 键
vbKeyX 88 字母 X 键
vbKeyY 89 字母 Y 键
vbKeyZ 90 字母 Z 键
vbKey0 48 数字 0 键
vbKey1 49 数字 1 键
vbKey250数字 2 键
vbKey3 51 数字 3 键
vbKey4 52 数字 4 键
vbKey553 数字 5 键
vbKey6 54 数字 6 键
vbKey7 55 数字 7 键
vbKey8 56 数字 8 键
vbKey9 57 数字 9 键
vbKeyF1 0x70 F1 功能键
vbKeyF2 0x71 F2 功能键
vbKeyF3 0x72 F3 功能键
vbKeyF4 0x73 F4 功能键
vbKeyF5 0x74 F5 功能键
vbKeyF6 0x75 F6 功能键
vbKeyF7 0x76 F7 功能键
vbKeyF8 0x77 F8 功能键
vbKeyF9 0x78 F9 功能键
vbKeyF10 0x79 F10 功能键
vbKeyF11 0x7A F11 功能键
vbKeyF12 0x7B F12 功能键
vbKeyF13 0x7C F13 功能键
vbKeyF14 0x7D F14 功能键
vbKeyF15 0x7E F15 功能键
vbKeyF16 0x7F F16 功能键
vbKeyNumpad0 0x60 小键盘 0 键
vbKeyNumpad1 0x61 小键盘 1 键
vbKeyNumpad3 0x63 小键盘 3 键
vbKeyNumpad4 0x64 小键盘 4 键
vbKeyNumpad5 0x65 小键盘 5 键
vbKeyNumpad6 0x66 小键盘 6 键
vbKeyNumpad7 0x67 小键盘 7 键
vbKeyNumpad8 0x68 小键盘 8 键
vbKeyNumpad9 0x69 小键盘 9 键
vbKeyMultiply 0x6A 小键盘 * 键
vbKeyAdd 0x6B 小键盘 + 键
vbKeySeparator 0x6C 小键盘回车键
vbKeySubtract 0x6D 小键盘 - 键
vbKeyDecimal 0x6E 小键盘 . 键
vbKeyDivide 0x6F 小键盘 / 键


Delphi 键盘码表


VK_LBUTTON = 1;
VK_RBUTTON = 2;
VK_CANCEL = 3;
VK_MBUTTON = 4; { NOT contiguous with L & RBUTTON }
VK_BACK = 8;
VK_TAB = 9;
VK_CLEAR = 12;
VK_RETURN = 13;
VK_SHIFT = $10;
VK_CONTROL = 17;
VK_MENU = 18;
VK_PAUSE = 19;
VK_CAPITAL = 20;
VK_KANA = 21;
VK_HANGUL = 21;
VK_JUNJA = 23;
VK_FINAL = 24;
VK_HANJA = 25;
VK_KANJI = 25;
VK_CONVERT = 28;
VK_NONCONVERT = 29;
VK_ACCEPT = 30;
VK_MODECHANGE = 31;
VK_ESCAPE = 27;
VK_SPACE = $20;
VK_PRIOR = 33;
VK_NEXT = 34;
VK_END = 35;
VK_HOME = 36;
VK_LEFT = 37;
VK_UP = 38;
VK_RIGHT = 39;
VK_DOWN = 40;
VK_SELECT = 41;
VK_PRINT = 42;
VK_EXECUTE = 43;
VK_SNAPSHOT = 44;
VK_INSERT = 45;
VK_DELETE = 46;
VK_HELP = 47;
{ VK_0 thru VK_9 are the same as ASCII '0' thru '9' ($30 - $39) }
{ VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' ($41 - $5A) }
VK_LWIN = 91;
VK_RWIN = 92;
VK_APPS = 93;
VK_NUMPAD0 = 96;
VK_NUMPAD1 = 97;
VK_NUMPAD2 = 98;
VK_NUMPAD3 = 99;
VK_NUMPAD4 = 100;
VK_NUMPAD5 = 101;
VK_NUMPAD6 = 102;
VK_NUMPAD7 = 103;
VK_NUMPAD8 = 104;
VK_NUMPAD9 = 105;
VK_MULTIPLY = 106;
VK_ADD = 107;
VK_SEPARATOR = 108;
VK_SUBTRACT = 109;
VK_DECIMAL = 110;
VK_DIVIDE = 111;
VK_F1 = 112;
VK_F2 = 113;
VK_F3 = 114;
VK_F4 = 115;
VK_F5 = 116;
VK_F6 = 117;
VK_F7 = 118;
VK_F8 = 119;
VK_F9 = 120;
VK_F10 = 121;
VK_F11 = 122;
VK_F12 = 123;
VK_F13 = 124;
VK_F14 = 125;
VK_F15 = 126;
VK_F16 = 127;
VK_F17 = 128;
VK_F18 = 129;
VK_F19 = 130;
VK_F20 = 131;
VK_F21 = 132;
VK_F22 = 133;
VK_F23 = 134;
VK_F24 = 135;
VK_NUMLOCK = 144;
VK_SCROLL = 145;
{ VK_L & VK_R - left and right Alt, Ctrl and Shift virtual keys.
Used only as parameters to GetAsyncKeyState() and GetKeyState().
No other API or message will distinguish left and right keys in this way. }
VK_LSHIFT = 160;
VK_RSHIFT = 161;
VK_LCONTROL = 162;
VK_RCONTROL = 163;
VK_LMENU = 164;
VK_RMENU = 165;
VK_PROCESSKEY = 229;
VK_ATTN = 246;
VK_CRSEL = 247;
VK_EXSEL = 248;
VK_EREOF = 249;
VK_PLAY = 250;
VK_ZOOM = 251;
VK_NONAME = 252;
VK_PA1 = 253;
VK_OEM_CLEAR = 254; 
阅读(1326) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~