View previous topic :: View next topic |
Author |
Message |
Moo
Joined: 13 Jan 2007 Posts: 42
|
Posted: Wed Aug 01, 2007 4:05 pm Post subject: |
|
Code: | if Key = VK_Left then begin
kkas_notiek
end; |
Vienkārši, ne? _________________ Moo |
|
Back to top |
|
|
Kamazs Guru
Joined: 17 Jan 2003 Posts: 829 Location: The glorious ancient city of Loja
|
Posted: Wed Aug 01, 2007 4:06 pm Post subject: |
|
Mazliet offtopics, bet ... par Shiftu runājot...paskaties TShiftState klasi vai kas jams skaitās ieksh Helpa (nospied F1 un ieraksti).
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
Var redzeet, ka proceduura piedaavaa tev izmantot arii mainiigo Shift, kura veertiibu var paarbaudiit. Ar mugurkaulu juutu, ka Shift vareetu buut veertība ssPressed or smth -- skaties helpaa.
Vispaar Delphi helps ir ljoti labs, to veerts izmantot. _________________ ...un es uzskatu, ka Fallout ir etalons |
|
Back to top |
|
|
Moo
Joined: 13 Jan 2007 Posts: 42
|
Posted: Wed Aug 01, 2007 4:15 pm Post subject: |
|
Nebūtu help faila es nezinātu pārējo key nosaukumus un cipariņus.
Value Meaning
ssShift The Shift key is held down.
Paldies, Kamaz un Coderpp. Tagad kādu laiciņu zubrīšos pa Help failu _________________ Moo |
|
Back to top |
|
|
coderpp
Joined: 20 Aug 2005 Posts: 167 Location: Rīga, Koknese, Gajiena
|
Posted: Wed Aug 01, 2007 6:25 pm Post subject: |
|
coderpp wrote: | Code: |
If ((GetKeyState(VK_LSHIFT) AND 128)=128) and ((GetKeyState(ord('a')) AND 128)=128) then
ShowMessage('SHIFT+A Pressed');
|
|
Intereses pēc uzinstalēju Delphi 7, un pārbaudīju to kodu. Kods strādā, ja mazo 'a' aizstāj ar lielo 'A' burtu.
Code: |
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
If ((GetKeyState(VK_LSHIFT) AND 128)=128) and ((GetKeyState(ord('A')) AND 128)=128) then
ShowMessage('SHIFT+A Pressed');
end; |
|
|
Back to top |
|
|
Moo
Joined: 13 Jan 2007 Posts: 42
|
Posted: Wed Aug 01, 2007 6:31 pm Post subject: |
|
Milziigs paldies!!! Un man pat straadaa
(BTW, es uz Turbo Delphi) _________________ Moo |
|
Back to top |
|
|
bubu Indago Uzvarētājs
Joined: 23 Mar 2004 Posts: 3223 Location: Riga
|
Posted: Wed Aug 01, 2007 7:30 pm Post subject: |
|
mja, uz keydown eventa pārbaudīt vēlreiz pogu nospiedienus.. Neliekas pašam dīvaini? |
|
Back to top |
|
|
coderpp
Joined: 20 Aug 2005 Posts: 167 Location: Rīga, Koknese, Gajiena
|
Posted: Wed Aug 01, 2007 8:01 pm Post subject: |
|
Nu jā, mazliet dīvaini ir. Šis variants tomēr būs labāks. Tas pats par ko Kamazs rakstīja.
Code: |
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if (Shift = [ssShift]) and (key = ord('A')) then
ShowMessage('shift + a pressed');
end;
|
|
|
Back to top |
|
|
|