Arsip: virtual key

more 16 years ago
Yudho
Sori bro. Aku boleh nimbrung gak?
Niy ada hubunganya banget dengan pertanyaan diatas. Aku coba untuk kkode TAB(vk_tab) koq nggak bisa ya?
trus kalo kode ascii nya tab(vk_tab) berapa ya? kan kalo enter(vk_enter)=#13
trus kalo tab(vk_tab) berapa?

more 16 years ago
ansr
Aku juga mo nanya nih?
kalo neken shift terus escape..... di event KeyDown
aku pake script ini
if(shift = ssShift) and (key = VK_ESCAPE) then
begin
if button1.Visible = false then
button1.Visible := true
else
button1.Visible := false;
end;
selalu error incompatible types padahal unit classes sudah ada..
mohon bantuannya..... trims :)
more 16 years ago
Manz
@ansr: error incompatible typesitu berarti antara shift dengan key itu typedatanya tidak sama mas .... hihihihi :D

more 16 years ago
kaka-delphi
Oh .. yach ... klo diriku untuk mengetahui tombol Shift, Ctrl, Alt dipencet, diriku suka pake fungsi berikut :
ini untuk yang shift
function ShiftDown : Boolean;
var
State : TKeyboardState;
begin
GetKeyboardState(State) ;
// ini untuk tombol Shift
Result := ((State[VK_SHIFT] and 128) <> 0) ;
end;
Misal untuk Shift+Esc berarti sbb :
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((ShiftDown) and (Key = VK_ESCAPE)) then
ShowMessage('OKE');
end;
koding tersebut berlaku untuk shift kiri dan kanan.
Untuk tombol Ctrl atau Alt, anda bisa mengubah index State-nya dengan virtual key codes nya, seperti :
function ShiftDown : Boolean;
var
State : TKeyboardState;
begin
GetKeyboardState(State) ;
// ini untuk tombol Shift
Result := ((State[VK_SHIFT] and 128) <> 0) ;
// ini untuk tombol Ctrl
// Result := ((State[VK_CONTROL] and 128) <> 0) ;
// ini untuk tombol Alt
// Result := ((State[VK_MENU] and 128) <> 0) ;
end;
SEMANGAT ;)
more 16 years ago
mas_kofa
@manz_delphi: vk_tab biasanya#8, vk_esc biasanya#27, hihihihihihi :Dtombol spasi nilainya juga#8ya?????
more ...
- Pages:
- 1
- 2
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 2 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 2 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 3 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 10 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 10 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 10 years ago
Random Topic
- membuat laporan dngan RVReport
by yoppie in Reporting more 14 years ago - fungsi OnChange pada TDBLookupComboBox?
by o-dad in Tip n Trik Pemrograman more 14 years ago - Delphi 2009, Lazarus 0.9.26 dan Delphi Prism
by deLogic in Komersial more 14 years ago - dll untuk resource
by greatjon2002 in Tip n Trik Pemrograman more 16 years ago - example SIM
by agso in Hal umum tentang Pascal Indonesia more 14 years ago - tanya logika n tabel utk stock barang
by budhie_yk in Tip n Trik Pemrograman more 14 years ago - Windows Logon
by ir1keren in Enginering more 15 years ago - Buat installer Mysql secara otomatis
by hendra_sir84 in Hal umum tentang Pascal Indonesia more 14 years ago - {req}penggunaan quick report
by Iansx in Hal umum tentang Pascal Indonesia more 16 years ago - Buat CAD gimana ya.................
by meinardi in Enginering more 16 years ago