各位大虾:
请问 如何判断用户 按下了Ctr+Shift 或 Ctr+空格?
     如何判断用户 用户改变了输入法????

解决方案 »

  1.   

    在 元件 的 OnKeyPress 或者 OnKeyDown 里面判断
      

  2.   

    OnKeyPress 和OnKeyDown是有区别的!
    OnKeyPress只能够响应具有标准ASCII码的键盘事件,比如数字键,字母键;
    而OnKeyDown可以响应非标准ASCII码的键盘事件,比如[Shift]键,功能键F1-F12
      

  3.   

    不知如何辨别同时按下两个键!单个就会;)
    procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if ord(Key)=16 then
        showmessage('按了Shift键');
      if ord(Key)=17 then
        showmessage('按了Ctrl键');end;
      

  4.   

    if (ssctrl in shift) and (key =VK_Shift) then// 如果按的键是Ctrl+Shift
     showmessage('哈哈,按下了Ctrl+Shift');   //空格类似
      

  5.   

    我来总结一下给你个直接的例子:
    { D7 调试通过 }
    procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if (ssShift in Shift) and (ssCtrl in Shift) then 
        if key = $20 then form1.Caption:='Ctrl+Shift+[ ]';
    end;