在keydown里面写
if shift = ssCtrl then
begin
 if key =vk_Left then  else if key= vk_Up  else if key= vk_Right  else if key=vk_Down 
end;

解决方案 »

  1.   

    N21.ShortCut:=VK_LWIN+vk_Left ;
      N21.ShortCut:=VK_LWIN+vk_Right ;
    ..........
      

  2.   

    回成资料:你的键盘是104键以上的吗?如果是,在Ctrl 和 Alt 之间的那个窗口键就是 Win 键
    回路漫漫:可否给出解释???
      

  3.   

    回taidy:你那招没用呀,用了以后快捷键显示为 F19(太酷了吧,战斗鸡???)
    而且根本没有用的
      

  4.   

    我想你应该需要用到RegistryHotKey这个API---向OS注册全局变量!具体操作方法请参阅Delphi Online Help[注]:RegistryHotKey?不知道 有没有写错 :-)
    [对于上述回复不作正确性保证!]
    [我是回来看看你们的~~我想你们~~]
      

  5.   

    FKeyDownWin: Boolean;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      case Key of
        VK_LWIN, VK_RWIN: FKeyDownWin := True;
        VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN:
          if FKeyDownWin then
            Caption := Format('(Win)Now:%.6f, Key:%d', [Now, Key])
          else if Shift = [ssCtrl] then
            Caption := Format('(Ctrl)Now:%.6f, Key:%d', [Now, Key])
      end;
    end;procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      case Key of
        VK_LWIN, VK_RWIN: FKeyDownWin := False;
      end;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      KeyPreview := True;
    end;
      

  6.   

    //我只能处理四个
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
        procedure FormDestroy(Sender: TObject);
      private
        { Private declarations }
        FHotKeyLeft: Integer;
        FHotKeyRight: Integer;
        FHotKeyDown: Integer;
        FHotKeyUp: Integer;
        procedure WMHOTKEY(var Msg: TWMHOTKEY); message WM_HOTKEY;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    begin
      if GlobalFindAtom('FHotKeyLeft') <> 0 then Halt;
      if GlobalFindAtom('FHotKeyRight') <> 0 then Halt;
      if GlobalFindAtom('FHotKeyDown') <> 0 then Halt;
      if GlobalFindAtom('FHotKeyUp') <> 0 then Halt;
      FHotKeyLeft := GlobalAddAtom('FHotKeyLeft');
      RegisterHotKey(Handle, FHotKeyLeft, MOD_CONTROL, VK_LEFT);
      FHotKeyRight := GlobalAddAtom('FHotKeyRight');
      RegisterHotKey(Handle, FHotKeyRight, MOD_CONTROL, VK_RIGHT);
      FHotKeyDown := GlobalAddAtom('FHotKeyDown');
      RegisterHotKey(Handle, FHotKeyDown, MOD_CONTROL, VK_DOWN);
      FHotKeyUp := GlobalAddAtom('FHotKeyUp');
      RegisterHotKey(Handle, FHotKeyUp, MOD_CONTROL, VK_UP);
    end;procedure TForm1.FormDestroy(Sender: TObject);
    begin
      UnRegisterHotKey(Handle, FHotKeyLeft);
      UnRegisterHotKey(Handle, FHotKeyRight);
      UnRegisterHotKey(Handle, FHotKeyDown);
      UnRegisterHotKey(Handle, FHotKeyUp);
      GlobalDeleteAtom(FHotKeyLeft);
      GlobalDeleteAtom(FHotKeyRight);
      GlobalDeleteAtom(FHotKeyDown);
      GlobalDeleteAtom(FHotKeyUp);
    end;procedure TForm1.WMHOTKEY(var Msg: TWMHOTKEY);
    begin
      if Msg.HotKey = FHotKeyLeft then
        ShowMessage('FHotKeyLeft')
      else if Msg.HotKey = FHotKeyRight then
        ShowMessage('FHotKeyRight')
      else if Msg.HotKey = FHotKeyDown then
        ShowMessage('FHotKeyDown')
      else if Msg.HotKey = FHotKeyUp then
        ShowMessage('FHotKeyUp');
    end;end.
      

  7.   

    //没想到还能再处理四个
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
        procedure FormDestroy(Sender: TObject);
      private
        { Private declarations }
        FHotKeyLeft: Integer;
        FHotKeyRight: Integer;
        FHotKeyDown: Integer;
        FHotKeyUp: Integer;
        procedure WMHOTKEY(var Msg: TWMHOTKEY); message WM_HOTKEY;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    begin
      if GlobalFindAtom('FHotKeyLeft') <> 0 then Halt;
      if GlobalFindAtom('FHotKeyRight') <> 0 then Halt;
      if GlobalFindAtom('FHotKeyDown') <> 0 then Halt;
      if GlobalFindAtom('FHotKeyUp') <> 0 then Halt;
      FHotKeyLeft := GlobalAddAtom('FHotKeyLeft');
      RegisterHotKey(Handle, FHotKeyLeft, MOD_WIN, VK_LEFT);
      FHotKeyRight := GlobalAddAtom('FHotKeyRight');
      RegisterHotKey(Handle, FHotKeyRight, MOD_WIN, VK_RIGHT);
      FHotKeyDown := GlobalAddAtom('FHotKeyDown');
      RegisterHotKey(Handle, FHotKeyDown, MOD_WIN, VK_DOWN);
      FHotKeyUp := GlobalAddAtom('FHotKeyUp');
      RegisterHotKey(Handle, FHotKeyUp, MOD_WIN, VK_UP);
    end;procedure TForm1.FormDestroy(Sender: TObject);
    begin
      UnRegisterHotKey(Handle, FHotKeyLeft);
      UnRegisterHotKey(Handle, FHotKeyRight);
      UnRegisterHotKey(Handle, FHotKeyDown);
      UnRegisterHotKey(Handle, FHotKeyUp);
      GlobalDeleteAtom(FHotKeyLeft);
      GlobalDeleteAtom(FHotKeyRight);
      GlobalDeleteAtom(FHotKeyDown);
      GlobalDeleteAtom(FHotKeyUp);
    end;procedure TForm1.WMHOTKEY(var Msg: TWMHOTKEY);
    begin
      if Msg.HotKey = FHotKeyLeft then
        ShowMessage('FHotKeyLeft')
      else if Msg.HotKey = FHotKeyRight then
        ShowMessage('FHotKeyRight')
      else if Msg.HotKey = FHotKeyDown then
        ShowMessage('FHotKeyDown')
      else if Msg.HotKey = FHotKeyUp then
        ShowMessage('FHotKeyUp');
    end;end.