Autor Beitrag
matzehl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mi 15.12.04 15:54 
Hallo Leute

Hänge mal wieder etwas fest. Ich hab ein Problem mit dem Erkennen einer bestimmten Tastenkombination. Ich will die Tastenkombination Shift + Rechts bzw Shift + Links verwenden. Der Quelltext hier funzt schon :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if (shift = ([ssAlt, ssCtrl])) then showmessage('Tastenkürzel empfangen!');
end;


Damit erkenne ich schon mal, wenn der User Alt und Strg gleichzeitig drückt.
Allerdings funktioniert das nicht für meine Tastenkombinationen.
Eigentlich müsste das doch so gehen, oder?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if (shift = ([ssCtrl, ssRight])) then showmessage('Tastenkürzel empfangen!');
end;


Danke schon mal! :P

MfG

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Mi 15.12.04 16:05 
probier mal den hier der funktioniert bei mir(Strg+Rechts):
ausblenden Delphi-Quelltext
1:
2:
 if (shift = [ssCtrl]) AND (Key = vk_Right) then 
  showmessage('Tastenkürzel empfangen!');


//Edit:Das Problem war einfach das 'Rechts' kein Shift-State ist sondern ein Key.Und ssRight is der Rechte Mausknopf :D)

mfg matze

_________________
si tacuisses, philosophus mansisses.
matzehl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Do 16.12.04 09:03 
Funktioniert! Danke! :D
eXploit4D
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21


D7 Enterprise
BeitragVerfasst: Do 16.12.04 10:44 
gibts hier ne liste wo die namen aller tasten aufgeschrieben sind? ... würde die tastenkombination gerne mit anderen tasten machen
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 16.12.04 10:51 
Die stehen imho in der OH unter "virtuelle Tastencodes".
eXploit4D
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21


D7 Enterprise
BeitragVerfasst: Do 16.12.04 11:03 
okay danke .. bei mir unter

visual kex codes wegen englischem Delphi
Kevkong
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Mi 05.01.05 15:28 
Hi,

wir fangen demnächst in der Schule ein Projekt an und das besteht darin, dass wir ein Spiel oder ein anspruchvolles programm erstellen sollen ... dabei bin ich auf ein Problem gestoßen unzwar wie kann ich die Tastenkombination Pfeilhoch und Pfeillinks gleichzeitig abgreifen ? natürlich möchte ich das auch mit den jeweils anderen machen also Hoch+rechts dann noch runter+rechts und schliesslich runter+links !

Wäre nett wenn mir jemand helfen kann ;)
Kevkong
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Mi 05.01.05 17:44 
Hi,

sorry war zu voreilig hab es jetzt schon hinbekommen ;)