Autor Beitrag
Zimond
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 49



BeitragVerfasst: So 10.09.06 15:46 
Moin.

Ich durchsuche mir hier im Forum schon nen Wolf um raus zubekommen wie ich bestimmte Funktionstasten abfragen kann. Die häufigste Antwort ist in einem OnKeyDown ereigniss reinzuhaben :

ausblenden Delphi-Quelltext
1:
if key = vk_irgendwas then ....					


Das funktioniert ja auch mit so ziemlich jeder Taste (Esc, enter, pfeiltasten ect) nur aber nicht mit der Tabulator Taste, da diese das OnKeyDown Event überhaupt nicht erst auslöst. Ich habe auch etwas über die Einstellung keypreview auf der Form gelesen, welche man auf True setzen muss, auch dass hilft nichts und laut Delphi Hilfe hat diese Einstellung bei Tasten wie eben TAB auch gar keine Wirkung.

Das einzige was mir ansonsten einfiele wäre eine Timer gesteuerte DirectInput Abfrage, aber das kann es doch nicht sein...
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 10.09.06 16:13 
Hallo,

:arrow: CM_DIALOGKEY abfangen.

Etwa so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
//...
private
  procedure CMDialogKey(var Message: TCMDialogKey); message CM_DIALOGKEY;
//...
procedure TForm1.CMDialogKey(var Message: TCMDialogKey);
begin
  with message do begin
    case charcode of
    vk_tab: showmessage('Tab ausgelöst');
    else
      inherited;//Standardverhalten sicherstellen
    end;
  end;
end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Zimond Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 49



BeitragVerfasst: So 10.09.06 16:19 
vielen dank für die prompte und explizite Antwort. Funzt perfekt :)