Delphi XE5 - Klavye Tuşlarını Yönetmek VK Tuşları Listesi
Delphide keydown olayını kullarak vk kodlarıyla istediğiniz olayı ateşleyebilirsiniz. Kullanım şekli örneğin:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key = VK_F5 then
showmessage('Hello Delphi')
end;
şeklindedir.
Key Code Constants
VK_LBUTTON 01 Left mouse button
VK_RBUTTON 02 Right mouse button
VK_CANCEL 03 Used for 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
-- 0A0B Undefined
VK_CLEAR 0C CLEAR key
VK_RETURN 0D ENTER key
-- 0E0F 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
-- 1C1F 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 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_1 31 1 key
VK_2 32 2 key
VK_3 33 3 key
VK_4 34 4 key
VK_5 35 5 key
VK_6 36 6 key
VK_7 37 7 key
VK_8 38 8 key
VK_9 39 9 key
-- 3A40 Undefined
VK_A 41 A key
VK_B 42 B key
VK_C 43 C key
VK_D 44 D key
VK_E 45 E key
VK_F 46 F key
VK_G 47 G key
VK_H 48 H key
VK_I 49 I key
VK_J 4A J key
VK_K 4B K key
VK_L 4C L key
VK_M 4D M key
VK_N 4E N key
VK_O 4F O key
VK_P 50 P key
VK_Q 51 Q key
VK_R 52 R key
VK_S 53 S key
VK_T 54 T key
VK_U 55 U key
VK_V 56 V key
VK_W 57 W key
VK_X 58 X key
VK_Y 59 Y key
VK_Z 5A Z key
-- 5B5F Undefined
VK_NUMPAD0 60 Numeric keypad 0 key
VK_NUMPAD1 61 Numeric keypad 1 key
VK_NUMPAD2 62 Numeric keypad 2 key
VK_NUMPAD3 63 Numeric keypad 3 key
VK_NUMPAD4 64 Numeric keypad 4 key
VK_NUMPAD5 65 Numeric keypad 5 key
VK_NUMPAD6 66 Numeric keypad 6 key
VK_NUMPAD7 67 Numeric keypad 7 key
VK_NUMPAD8 68 Numeric keypad 8 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_F2 71 F2 key
VK_F3 72 F3 key
VK_F4 73 F4 key
VK_F5 74 F5 key
VK_F6 75 F6 key
VK_F7 76 F7 key
VK_F8 77 F8 key
VK_F9 78 F9 key
VK_F10 79 F10 key
VK_F11 7A F11 key
VK_F12 7B F12 key
VK_F13 7C F13 key
VK_F14 7D F14 key
VK_F15 7E F15 key
VK_F16 7F F16 key
VK_F17 80H F17 key
VK_F18 81H F18 key
VK_F19 82H F19 key
VK_F20 83H F20 key
VK_F21 84H F21 key
VK_F22 85H F22 key
VK_F23 86H F23 key
VK_F24 87H F24 key
-- 88-8F Unassigned
VK_NUMLOCK 90 NUM LOCK key
VK_SCROLL 91 SCROLL LOCK key
--------
Subject: Re: KeyPress codes
Hellow Everybody
The scan codes that I use are:
VK_LBUTTON = 1; VK_RBUTTON = 2; VK_CANCEL = 3;
VK_MBUTTON = 4;
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_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;
0 yorum:
Yorum Gönder