Autor Beitrag
Phil511
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 08.02.07 22:08 
Kann mir jemand sagen wie der Virtuelle Tastencode für die Tasten W,A,S,D ist

Sowas mein ich:

VK_ESCAPE Taste Esc
VK_SPACE Taste Leer
VK_PRIOR Taste Bild auf
VK_NEXT Taste Bild ab
VK_END Taste Ende

Danek im Vorraus
mfg.Phil
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 08.02.07 22:12 
Ord('A') liefert dir den ANSI-Code von A. Ich denke, dass du damit auch den Tastencode erhälst.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 08.02.07 22:14 
Ganz einfach: VK_A, VK_D, VK_S und VK_W :P

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 08.02.07 22:19 
argh.. :(

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Phil511 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 08.02.07 22:23 
@jayeff: Wie meinst du das?

@BenBe: Das hab ich schon probiert geht aber ned ;-)

Also da brauch ichs...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
   if key = 'denn Code für a' then
      begin  
      end;
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 08.02.07 22:24 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
   if key = ord('A') then
      begin  
      end;

versuch mal so

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Do 08.02.07 22:26 
Oder so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if key = word('A') then .... // Zeichen muss groß geschrieben sein!
end;

grüße marc
Phil511 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Do 08.02.07 22:33 
Danke an alle! Also es funtzt mit word und mit ord!

Mfg.Phil
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Do 08.02.07 22:37 
user profile iconMarc. hat folgendes geschrieben:
Oder so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if key = word('A') then .... // Zeichen muss groß geschrieben sein!
end;

grüße marc

:shock: Das das funktioniert, ist reiner Zufall und so mit das Unsauberste, was ich bisher gesehen habe. Es ist ein Riesenunterschied, ob man ein Zeichen auf ein 16-bit Wort 'castet', oder den ordinalen Wert des Buchstabens 'A' im aktuellen lexikalischen Kontext ermittelt. Bei den Standard-Ascii Zeichen mag das funktionieren, aber bei Sonderzeichen wird das mit Sicherheit schief gehen.

Also bitte nicht nachmachen. :mahn:

Cool isses trotzdem :dance2:

_________________
Na denn, dann. Bis dann, denn.