模擬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 鼠標(biāo)左鍵
vbKeyRButton 0x2 鼠標(biāo)右鍵
vbKeyCancel 0x3 CANCEL鍵
vbKeyMButton 0x4 鼠標(biāo)中鍵
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 光標(biāo)左鍵
vbKeyUp 0x26 光標(biāo)上鍵
vbKeyRight 0x27 光標(biāo)右鍵
vbKeyDown 0x28 光標(biāo)下鍵
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 數(shù)字 0 鍵
vbKey1 49 數(shù)字 1 鍵
vbKey250數(shù)字 2 鍵
vbKey3 51 數(shù)字 3 鍵
vbKey4 52 數(shù)字 4 鍵
vbKey553 數(shù)字 5 鍵
vbKey6 54 數(shù)字 6 鍵
vbKey7 55 數(shù)字 7 鍵
vbKey8 56 數(shù)字 8 鍵
vbKey9 57 數(shù)字 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;