Pages

Subscribe:

About

Blog Ini membahas Tentang Delphi dari Tutorial, Source code, hingga Programming *Exe. Bersumber dari http://olvandra.blogspot.com

Jumat, 13 April 2012

Virtual Key

Virtual Key codes provide a symbolic representation of user key presses.
Unit  Windows  Description  Virtual key codes allow you to represent keyboard values for non-alphanumeric keys. Windowsdefines special constants for each key the user can press. These constants can then be used to refer to the keystroke in Windows API calls or in an OnKeyUp or OnKeyDown event handler.  Most of the virtual key codes are defined in the Windows unit. Additional key codes may be defined in special-purpose Windows wrappers such as the imm unit. For alphabetic keys, you should use ord with an uppercase character, for example, ord( 'M' ).   To create a virtual key code for an alphanumeric value, use the Ord method. For example the virtual

Dalam Bahasa Indonesianya :Kode kunci virtual memberikan representasi simbolis penekanan tombol pengguna.
Unit Windows Deskripsi Kode kunci virtual memungkinkan Anda untuk mewakili nilai-nilai keyboard untuk non-alfanumerik kunci. Jendela mendefinisikan konstanta khusus untuk setiap tombol pengguna dapat menekan. Konstanta ini kemudian dapat digunakan untuk merujuk pada keystroke dalam panggilan Windows API atau dalam onkeyup atau pawang OnKeyDown acara. Sebagian besar kode tombol virtual didefinisikan di unit Windows. Kode kunci tambahan mungkin didefinisikan dalam tujuan khusus pembungkus Windows seperti unit IMM. Untuk kunci alfabetis, Anda harus menggunakan Ord dengan karakter huruf besar, misalnya, Ord ('M'). Untuk membuat kode tombol virtual untuk nilai alfanumerik, gunakan metode Ord. Misalnya virtual

Fungsi Key Bisa digunakan dalam Pemrograman Borland Delphi sebagai Onkey pada Event Key Nya..

 



Virtual Key Code Corresponding key
VK_LBUTTON Left mouse button
VK_RBUTTON Right mouse button
VK_CANCEL Control+Break
VK_MBUTTON Middle mouse button
VK_BACK Backspace key
VK_TAB Tab key
VK_CLEAR Clear key
VK_RETURN Enter key
VK_SHIFT Shift key
VK_CONTROL Ctrl key
VK_MENU Alt key
VK_PAUSE Pause key
VK_CAPITAL Caps Lock key
VK_KANA Used with IME
VK_HANGUL Used with IME
VK_ESCAPE Esc key
VK_SPACE Space bar
VK_PRIOR Page Up key
VK_NEXT Page Down key
VK_END End key
VK_HOME Home key
VK_LEFT Left Arrow key
VK_UP Up Arrow key
VK_RIGHT Right Arrow key
VK_DOWN Down Arrow key
VK_SELECT Select key
VK_PRINT Print key (keyboard-specific)
VK_SNAPSHOT Print Screen key
VK_INSERT Insert key
VK_DELETE Delete key
VK_F1 F1 key
VK_F2 F2 key
VK_F3 F3 key
VK_F4 F4 key
VK_F5 F5 key
VK_F6 F6 key
VK_F7 F7 key
VK_F8 F8 key
VK_F9 F9 key
VK_F10 F10 key
VK_F11 F11 key
VK_F12 F12 key

Untuk Lengkapnya lihat di Link Ini
Virtual key ini biasanya digunakan dalam Hook media Aplikasi Keylogger
Contoh :

procedure TranslateKey(Key : Byte);
  begin
    if (Key <> VK_LBUTTON) and (Key <> VK_RBUTTON) then
    begin
      GetWindowText(GetForegroundWindow, Wnd2, SizeOf(Wnd2));
      if wnd1 <> wnd2 then
    begin
      MainForm.Memo.Lines.Add('
'+wnd2+' '); Wnd1 := Wnd2; end; end; with MainForm do begin case Key of VK_RETURN : Memo.Lines.Add('[Enter] '); VK_BACK : Memo.Lines.Add('[Backspace]'); VK_ESCAPE : Memo.Lines.Add('[Esc]');end; end; Contoh Penggalan code program diatas diambil dari aplikasi Keylogger. Code Lengkapnya : Link

0 komentar:

Posting Komentar

Untuk Mengurangi SPAM .Gunakan Kata-kata yang sewajarnya, sopan dalam tutur kata berbahasa. Sekian Terima kasih.

Visitor