unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls, Buttons, sndkey32, ExtCtrls; //关键是使用sndkey32单元<br><br>type<br> TSendKey = record<br> Name : ShortString;<br> VKey : Byte;<br> end;<br><br> TForm1 = class(TForm)<br> C_a: TSpeedButton;<br> C_b: TSpeedButton;<br> C_c: TSpeedButton;<br> C_d: TSpeedButton;<br> C_e: TSpeedButton;<br> C_f: TSpeedButton;<br> C_g: TSpeedButton;<br> C_h: TSpeedButton;<br> C_i: TSpeedButton;<br> C_j: TSpeedButton;<br> C_k: TSpeedButton;<br> C_l: TSpeedButton;<br> C_m: TSpeedButton;<br> C_n: TSpeedButton;<br> C_o: TSpeedButton;<br> C_p: TSpeedButton;<br> C_q: TSpeedButton;<br> C_r: TSpeedButton;<br> C_s: TSpeedButton;<br> C_t: TSpeedButton;<br> C_u: TSpeedButton;<br> C_v: TSpeedButton;<br> C_w: TSpeedButton;<br> C_x: TSpeedButton;<br> C_y: TSpeedButton;<br> C_z: TSpeedButton;<br> Comm_Tab: TSpeedButton;<br> Comm_CAPSLOCK: TSpeedButton;<br> Comm_BACKSPACE: TSpeedButton;<br> Comm_ENTER: TSpeedButton;<br> Comm_ESC: TSpeedButton;<br> Comm_Shift: TSpeedButton;<br> SpeedButton1: TSpeedButton;<br> C_: TSpeedButton;<br> N_1: TSpeedButton;<br> N_2: TSpeedButton;<br> N_3: TSpeedButton;<br> N_4: TSpeedButton;<br> N_5: TSpeedButton;<br> N_6: TSpeedButton;<br> N_7: TSpeedButton;<br> N_8: TSpeedButton;<br> N_9: TSpeedButton;<br> N_0: TSpeedButton;<br> Memo1: TMemo;<br> F_doudao: TSpeedButton;<br> F_juhao: TSpeedButton;<br> F_wenfao: TSpeedButton;<br> SpeedButton2: TSpeedButton;<br> SpeedButton3: TSpeedButton;<br> SpeedButton4: TSpeedButton;<br> SpeedButton5: TSpeedButton;<br> SpeedButton6: TSpeedButton;<br> SpeedButton7: TSpeedButton;<br> SpeedButton8: TSpeedButton;<br> SpeedButton9: TSpeedButton;<br> procedure C_aClick(Sender: TObject);<br> procedure Comm_TabClick(Sender: TObject);<br> procedure Comm_ShiftClick(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br> Sh:string;<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.C_aClick(Sender: TObject);<br>begin<br> SendKeys(Pchar(sh+(sender as TSpeedButton).Caption), false);<br> SpeedButton1.Down:=true;<br> sh:='';<br>end;<br><br>procedure TForm1.Comm_TabClick(Sender: TObject);<br>begin<br> SendKeys(Pchar('{'+(sender as TSpeedButton).Caption+'}'), false);<br>end;<br><br>procedure TForm1.Comm_ShiftClick(Sender: TObject);<br>begin<br> sh:='+';<br>end;<br><br>end.<br><br>简单吧