OnKeyDown/Up:
设置Form的KeyPriew=True;
然后在FormKeyDown种添加代码:if ssshift in shift then
  showmessage('Shift Down');
if ssctrl in shift then
  showmessage('Ctrl Down');
if ssalt in shift then
  showmessage('Alt Down');
if Key=97 then
  showmessage('A Down');
......
其他的类似,自己可以弄懂的吧?
至于GetKeyboardState() API我也忘记了:)

解决方案 »

  1.   

    下面是我写的一个测试程序,你可以从中看到那些键是同时按下的,例如按下'A',那么b[65]的值应该是81/80:)
    其他的不要我多说了吧。
    注意设置Form的KeyPriew:=True哦!
    procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    var
      b:TKeyBoardState;
      i:integer;
      str:string;
    begin
      GetKeyBoardState(b);
      Memo1.Clear;
      for i:=low(b) to high(b) do
      begin
        str:=str+format('%x ',[b[i]]);
        if (i+1) mod 16=0 then
        begin
          Memo1.Lines.Add(str);
          str:='';
        end;
      end;
    end;
      

  2.   

    kingron 能否把每个16 位所表示的意思告我
      

  3.   

    *&$(@)*$@,自己不会看帮助啊?
    高位是1,表示KeyDown,0==KeyUp,低位表示键的切换的状态,用于Caps Lock之类的键。
    帮助,看帮助吧。