如何让用户在同时按下:'a','b','c'这三个键时,系统才响应事件???

解决方案 »

  1.   

    抛砖引玉:
    var
      Form1: TForm1;
      a,b,c:boolean;
    implementation{$R *.dfm}procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
        a:=false;
        b:=false;
        c:=false;
        Caption:='f';
    end;procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
        if key=65 then a:=true;
        if key=66 then b:=true;
        if key=67 then c:=true;
        if a and b and c then Caption:='abc';
    end;
      

  2.   

    procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
        if key=65 then a:=false;
        if key=66 then b:=false;
        if key=67 then c:=false;
        Caption:='f';
    end;