dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Pogu kombinācijas
Goto page Previous  1, 2
 
dev.gamez.lv Forum Index -> Iesācējiem
View previous topic :: View next topic  
Author Message
Moo



Joined: 13 Jan 2007
Posts: 42

PostPosted: Wed Aug 01, 2007 4:05 pm    Post subject:

Code:
if Key = VK_Left then begin
kkas_notiek
end;

Vienkārši, ne? Very Happy
_________________
Moo
Back to top
View user's profile
Kamazs
Guru
Guru


Joined: 17 Jan 2003
Posts: 829
Location: The glorious ancient city of Loja

PostPosted: 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
View user's profile Send e-mail Visit poster's website
Moo



Joined: 13 Jan 2007
Posts: 42

PostPosted: 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 Very Happy
_________________
Moo
Back to top
View user's profile
coderpp



Joined: 20 Aug 2005
Posts: 167
Location: Rīga, Koknese, Gajiena

PostPosted: 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
View user's profile Send e-mail
Moo



Joined: 13 Jan 2007
Posts: 42

PostPosted: Wed Aug 01, 2007 6:31 pm    Post subject:

Shocked Surprised Milziigs paldies!!! Un man pat straadaa Very Happy
(BTW, es uz Turbo Delphi)
_________________
Moo
Back to top
View user's profile
bubu
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 23 Mar 2004
Posts: 3223
Location: Riga

PostPosted: 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
View user's profile Send e-mail
coderpp



Joined: 20 Aug 2005
Posts: 167
Location: Rīga, Koknese, Gajiena

PostPosted: 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
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Iesācējiem All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group