Autor Beitrag
-delphin-
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: So 24.07.05 17:41 
Simple Frage:
Wie kann ich den Befehl: IFigure.Left:=IFigure.Left+5 oder ähnliches auf die rechte Pfeiltaste, bzw eine andere Taste legen?
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: So 24.07.05 17:46 
Nimm das OnKeyDown-Ereignis. Dort fragst du nach der Taste ab, ob die der Verursacher ist, und reagierst dann mit dem Befehl.
chrissivo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: So 24.07.05 17:50 
Ich glaube zusätzlich muss KeyPreview als Eigenschaft des Formulars auf true stehen oder?

_________________
"... was ich noch zu sagen hätte dauert eine Zigarette, und ein letztes Glas im Steh'n..."
-delphin- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: So 24.07.05 18:11 
Hm is des kein einfacher Befehl? oO

btw OnKeyDown.. wo? oO bei Form / Ereignisse?
-delphin- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: So 24.07.05 18:16 
Okay das mit dem OnKeyDown Ereignis hab ich jetzt..
Jetz weiß ich bloß nicht, wie die Prozedur auszusehen hat, die das macht!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
//...
end;
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: So 24.07.05 18:27 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 case Key of
  vk_Right: begin
             IFigure.Left:=IFigure.Left+5
            end;
 end;
end;


@chrissivo: KeyPreview braucht man nicht umstellen.
-delphin- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: So 24.07.05 18:39 
Okay thx (;
-delphin- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: So 24.07.05 19:29 
und wie heißt die Taste 'Enter'? Bei vk_Enter sagt er mir undefinierter Bezeichner^^
pRoTeUs
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 47

Windows XP prof
Delphi 2005 prof
BeitragVerfasst: So 24.07.05 19:37 
äh ich nehm mal an du brauchst :
VK_RETURN

grüße proteus
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: So 24.07.05 19:44 
Delphi-Hilfe :arrow: Index :arrow: Virtuelle Tastencodes. Dort findest du (fast) alle.