应该可以吧;
因为key不同呀;

解决方案 »

  1.   

    to torble(阿裕):
    我只要在本系统内能接收到消息就可以了,用Hook不好(何况我不会^O^),关键是如何知道这两键同时按下了,同时按下'+'时不要在edit等中显示,不知如何将'+'当'Ctrl'用,perform可以吗?
      

  2.   

    你是想要在你的程序中实现热键,还是要在整个系统中实现?如果是程序中实现的话,窗体有个 KeyPreview 属性,把它设为 True 。如此一来键盘输入就先由窗体接收,然后再传送给窗体的子控件,然后你在 OnKeypress 事件中进行处理,把 '+' 过滤(处理)成 Ctrl ,最好自己做做实验
      

  3.   

    关键是怎么处理,有这样的API吗?
      

  4.   

    有个API 叫什么忘了,下线帮你找一下
      

  5.   

    //s存放ASC码String,i为你想得到ASCII Code的字符的Index,从0开始
    function TForm1.GetASCIICode(s: String; i: Integer): Byte;
    var
      p:PChar;
    begin
        p:=PChar(s);
        Result:=Byte(p[i]);
    end;
      

  6.   

    不好意思,上面的发错了……
    下面的才是给你的://我只弄成了-,+号模拟左右方向键,模拟Control失败……
    //估计对系统键的模拟要用系统钩子了
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, AppEvnts, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        ApplicationEvents1: TApplicationEvents;
        Memo1: TMemo;
        procedure OnMessage(var Msg: tagMSG;
          var Handled: Boolean);
        procedure FormCreate(Sender: TObject);  private
        { Private declarations }
      public
        { Public declarations }
        function KeyMapper(var Msg: tagMSG):Boolean;
      end;var
      Form1: TForm1;implementation{$R *.dfm}
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      Application.OnMessage:=OnMessage;
    end;function TForm1.KeyMapper(var Msg: tagMSG): Boolean;
    begin
      case Msg.WParam of
        VK_ADD: Msg.wParam:=VK_RIGHT;
        VK_SUBTRACT: Msg.wParam:=VK_LEFT;
      end;
      result:=false;
    end;procedure TForm1.OnMessage(var Msg: tagMSG; var Handled: Boolean);
    begin
      Handled:=false;
      case Msg.message of
        WM_KEYDOWN:Handled:=KeyMapper(Msg);
        WM_KEYUP:Handled:=KeyMapper(Msg);
        WM_CHAR:Handled:=KeyMapper(Msg); 
      end;
    end;end.
      

  7.   

    to Detective(探长) :
    谢了,我刚才也试了,模拟Control也失败了,请再帮关注一下,分稍后加。
      

  8.   

    刚刚加了一个函数
    procedure TForm1.SimControl(var Msg: tagMsg);
    begin
      Msg.wParam :=VK_CONTROL;
      PostMessage(Handle, Msg.message, Msg.wParam, Msg.lParam);
    end;KeyMapper作了相应修改,
    function TForm1.KeyMapper(var Msg: tagMSG): Boolean;
    begin
      case Msg.WParam of
        VK_ADD: Msg.wParam:=VK_RIGHT;
        VK_DIVIDE: SimControl(Msg);
        VK_SUBTRACT: Msg.wParam:=VK_LEFT;
      end;
      result:=false;
    end;还是失败了……