Autor Beitrag
makena76
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Mi 24.09.03 10:36 
Hallo Leute,

hab die Suchfunktion schon einmal bemüht; sie hat aber nix passendes ausgespuckt. Also ich würde gerne eine gedrückte Taste (STRG+L) bei Programmstart abfragen. Wie macht man das denn? Mit OnKeyPress scheint das nicht zu funktionieren, zumindest war ich bisher erfolglos.

Wäre super wenn mir jemand weiterhelfen könnte. Danke.

cu makena
Adrian
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 314



BeitragVerfasst: Mi 24.09.03 10:44 
Servus!

Versuchs mal mit keybd_event und VkKeyScan.

Gruß,

Adrian
makena76 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Do 25.09.03 08:32 
Hallo Adrian,

danke für Deinen Tip. Allerdings komme ich noch nicht so ganz klar. Habe gegooglet mit den Begriffen aber auch nichts passendes gefunden. Nur dass man damit an fremde Programme Tastendrücke senden kann. Ich werde mal weiter suchen. Oder vielleicht hast Du noch einen Tip wie ich damit den Tastendruck abfrage. Wäre super.

cu makena
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Do 25.09.03 08:46 
strg + l kommt mir irgendwie bekann vor (Prince of Prisa ?)

_________________
MFG
Michael Springwald, "kann kein englisch...."
makena76 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Do 25.09.03 09:50 
@mimi:
Nein nein, ich möchte die Tastenkombination bei meinem eigenen Programmstart abfragen. STRG+L für Layout...

Genauso wie bei Miranda und dem Profilmanager, der bei einer bestimmten Tastenkombination bei Programmstart angezeigt wird...
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Do 25.09.03 15:04 
könntes das ja so lösen:
du nimms du eine gobale variable und setzt sie beim onCreate auf True und wenn er fertig ist auf false und dann vergleichst du bei OnKeyPress die Taste und fertig...

_________________
MFG
Michael Springwald, "kann kein englisch...."
makena76 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Do 25.09.03 17:14 
@mimi:

Nach meinen Versuchen scheint es mir so, dass das OnKEyPress-Ereignis wohl erst nach der Create-Methode verarbeitet wird. Also ist das so für meine Zwecke nicht nutzbar - zumindest so wie ich es probiert habe (ähnlich deinem Vorschlag).

Da muss man wohl etwas systemnaher ran, aber da kenn ich mich nicht so gut aus. Naja ich hoffe es weiß noch jemand einen Tipp.

cu makena
Adrian
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 314



BeitragVerfasst: Fr 26.09.03 12:13 
Servus!

Es geht sogar noch einfacher, als ich zuerst gedacht habe.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject);
begin
  If (GetKeyState(17)<0) and (GetKeyState(76)<0) then
  begin
    // tu irgendwas
  end;
end;


Gruß,

Adrian
makena76 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Fr 26.09.03 22:56 
@adrian

hey super, danke dir, läuft perfekt :-)

cu makena