in the form.onkeydown()
if (ssCtrl in shift) then
 begin
if (key = 84) then              //ctrl+T
    pcDock.Visible := not PCDock.Visible
  else if (key = 67) then        //ctrl+C
    if pcDock.Visible  = true then
      pcDock.TabIndex := 1;
end;
截获不到Ctrl+T and Ctrl+C 为什么????

解决方案 »

  1.   

    这样试试:
    if   (ssCtrl   in   shift)  and (key = 84) then
      

  2.   

    焦点必须在form上才可以。
    为了实现form拦截,请使用form.keypreview := true;在属性栏也可以设置。
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
          ////见 delphi 帮助 keyboard events - Example  (KeyPreview property Example)
          Button1.Enabled:= false; //一定要啊,Form 得到焦点
          KeyPreview := true;    //一定要啊
          
         //发送ctrl+C
          keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), 0, 0);
        keybd_event(ord('C'), MapVirtualKey(ord('C'), 0), 0, 0); 
        keybd_event(ord('C'), MapVirtualKey(ord('C'), 0), KEYEVENTF_KEYUP, 0); 
        keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), KEYEVENTF_KEYUP, 0);
    end;
      

  4.   

    form.preview 已经为true,
    还是不响应,
    用 if ((getkeystate(vk_control) and 128) = 128) and 
         ((getkeystate(ord('T')) and 128 = 128) then
    pcdock.visible := false;可是必须先按T,再按Ctrol,才响应,??????????????
      

  5.   

    是不是你把Ctrl+T快捷给某个菜单或Action了