Ich kann leider auch nix genaueres zu der Funktionsweiße sagen, nur dass ich meine Quellenprocedure so umgeschrieben hab, dass sie mir erstma die Stati der Control Tasten speichert und dann auf Änderungen vergleicht und diese ausgibt.
Quelle
Delphi-Quellcode:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var b1, b2, b3: integer;
Taststring: string;
begin
if GetKeyState(16) and (-32768+128) <> 0 then b1 := 1 else b1 := 0;
if GetKeyState(17) and (-32768+128) <> 0 then b2 := 1 else b2 := 0;
if GetKeyState(18) and (-32768+128) <> 0 then b3 := 1 else b3 := 0;
Taststring := '';
if (b1 = 1) and (GetKeyState(160) and (-32768+128) <> 0) then Taststring := 'linke Shift';
if (b1 = 1) and (GetKeyState(161) and (-32768+128) <> 0) then Taststring := 'rechte Shift';
if (b2 = 1) and (GetKeyState(162) and (-32768+128) <> 0) thenTaststring := 'linke STRG';
if (b2 = 1) and (GetKeyState(163) and (-32768+128) <> 0) then Taststring := 'rechte STRG';
if (b3 = 1) and (GetKeyState(164) and (-32768+128) <> 0) then Taststring := 'linke Alt';
if (b3 = 1) and (b2 = 1) and (GetKeyState(165) and (-32768+128) <> 0) then
if Taststring = 'linke STRG' then Taststring := 'rechte AltGr';
if (GetKeyState(20) and (-32768+128) <> 0) then Taststring := 'linke Feststell-Shift';
Label1.Caption := Taststring;
end;
MfG