Led Kontrolleri

Led Kontrolleri Kod: procedure TForm1.Timer1Timer(Sender: TObject); function SetState(Key: Integer; Value: Boolean): Boolean; begin   if Odd(GetAsyncKeyState(Key)) <> Value then   begin     keybd_event(Key, MapVirtualkey(Key, 0), KEYEVENTF_EXTENDEDKEY, 0);     keybd_event(Key, MapVirtualkey(Key, 0), KEYEVENTF_EXTENDEDKEY or       KEYEVENTF_KEYUP, 0);   end; end; begin SetState(VK_NUMLOCK, True);   Sleep(50);   SetState(VK_NUMLOCK, False);   Sleep(50);   SetState(VK_CAPITAL, True);   Sleep(50);   SetState(VK_CAPITAL, False);   Sleep(50);   SetState(VK_SCROLL, True);   Sleep(50);   SetState(VK_SCROLL, False);   Sleep(50);   SetState(VK_CAPITAL, True);   Sleep(50);   SetState(VK_CAPITAL, False);   Sleep(50);   end; //*** Mesela bir timer ın event ına bu kodu yazın. Bilgisayarda belirli bir süre //***hareket olmadığında bu timer ı aktif hale getirin. //*** Klavyedeki ışıklar beirli bir düzenle yanıp sönmeye başlayacaktır :-)) //***Hadi kolay gelsin...kod 2 Kod: //KLAVYEDEKİ IŞIKLARI SOLDAN SAĞA DOĞRU KAYDIRMAK //CODED BY FERHAT AKKAŞ 3.7.2002 http://www.ferhat.tr.cx/ //1 adet timer, 2 adet buton ekleyelim. unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,   Dialogs, StdCtrls, ExtCtrls; type   TForm1 = class(TForm)     Button1: TButton;     Timer1: TTimer;     Button2: TButton;     procedure Button1Click(Sender: TObject);     procedure Timer1Timer(Sender: TObject);     procedure Button2Click(Sender: TObject);     procedure FormCreate(Sender: TObject);   private     { Private declarations }   public     { Public declarations }   end; var   Form1: TForm1;   F: TKeyboardState; (*** ÖNEMLİ ***) implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin timer1.Interval:=500; timer1.Enabled:=true; end; procedure TForm1.Timer1Timer(Sender: TObject); begin   if F[VK_NUMLOCK] = 0 then F[VK_NUMLOCK] := 1   else F[VK_NUMLOCK] := 0;   sleep(100);   SetKeyboardState(F);   if F[vk_capital] = 0 then F[vk_capital] := 1   else F[vk_capital] := 0;   sleep(100);   SetKeyboardState(F);   if F[vk_Scroll] = 0 then F[vk_Scroll] := 1   else F[vk_Scroll] := 0;   sleep(100);   SetKeyboardState(F); end; procedure TForm1.Button2Click(Sender: TObject); begin FORM1.ONCreate(SENDER); end; procedure TForm1.FormCreate(Sender: TObject); begin timer1.Enabled:=false; GetKeyboardState(F); F[vk_Scroll]:= 0; F[vk_NumLock]:= 0; F[vk_Capital]:= 0; SetKeyboardState(F); end; end.kod 3 Kod: -left to right procedure TForm1.Button1Click(Sender: TObject); begin Timer1.Interval:=500; Timer1.enabled:=true; end; procedure TForm1.Button2Click(Sender: TObject); begin Timer1.enabled:=false; end; procedure TForm1.Timer1Timer(Sender: TObject); var keys : TKeyboardState; begin GetKeyboardState( keys );    keys[VK_NUMLOCK] := 1;    SetKeyboardState( keys );    sleep(50);    GetKeyboardState( keys );    keys[VK_NUMLOCK] := 0;    SetKeyboardState( keys );    sleep(50);    GetKeyboardState( keys );    keys[VK_CAPITAL] := 1;    SetKeyboardState( keys );    sleep(60);    GetKeyboardState( keys );    keys[VK_CAPITAL] := 0;    SetKeyboardState( keys );    sleep(60);    GetKeyboardState( keys );    keys[VK_SCROLL]  := 1;    SetKeyboardState( keys );    sleep(50);    GetKeyboardState( keys );    keys[VK_SCROLL]  := 0;    sleep(5);    SetKeyboardState( keys );    GetKeyboardState( keys ); end; ---------------------------------------------------------------------- -Right to left procedure TForm1.Button1Click(Sender: TObject); begin Timer1.Interval:=500; Timer1.enabled:=true; end; procedure TForm1.Button2Click(Sender: TObject); begin Timer1.enabled:=false; end; procedure TForm1.Timer1Timer(Sender: TObject); var keys : TKeyboardState; begin    GetKeyboardState( keys );    keys[VK_SCROLL]  := 1;    SetKeyboardState( keys );    sleep(5);    GetKeyboardState( keys );    keys[VK_SCROLL]  := 0;    SetKeyboardState( keys );    sleep(50);    GetKeyboardState( keys );    keys[VK_CAPITAL] := 1;    SetKeyboardState( keys );    sleep(60);    GetKeyboardState( keys );    keys[VK_CAPITAL] := 0;    SetKeyboardState( keys );    sleep(60);    GetKeyboardState( keys );    keys[VK_NUMLOCK] := 1;    SetKeyboardState( keys );    sleep(50);    GetKeyboardState( keys );    keys[VK_NUMLOCK] := 0;    SetKeyboardState( keys );    sleep(50); end; ------------------------------------------------------------------------------------------------- night rider / left <>right procedure TForm1.Button1Click(Sender: TObject); begin Timer1.Interval:=500; Timer1.enabled:=true; end; procedure TForm1.Button2Click(Sender: TObject); begin Timer1.enabled:=false; end; procedure TForm1.Timer1Timer(Sender: TObject); var keys : TKeyboardState; begin GetKeyboardState( keys );    keys[VK_NUMLOCK] := 1;    SetKeyboardState( keys );    sleep(100);    GetKeyboardState( keys );    keys[VK_NUMLOCK] := 0;    SetKeyboardState( keys );    sleep(100);    GetKeyboardState( keys );    keys[VK_CAPITAL] := 1;    SetKeyboardState( keys );    sleep(120);    GetKeyboardState( keys );    keys[VK_CAPITAL] := 0;    SetKeyboardState( keys );    sleep(120);    GetKeyboardState( keys );    keys[VK_SCROLL]  := 1;    SetKeyboardState( keys );    sleep(100);    GetKeyboardState( keys );    keys[VK_SCROLL]  := 0;    sleep(100);    SetKeyboardState( keys );    GetKeyboardState( keys );    keys[VK_CAPITAL] := 1;    SetKeyboardState( keys );    sleep(120);    GetKeyboardState( keys );    keys[VK_CAPITAL] := 0;    SetKeyboardState( keys );    sleep(120);    GetKeyboardState( keys );    keys[VK_NUMLOCK] := 0;    SetKeyboardState( keys );    sleep(100);    GetKeyboardState( keys );    keys[VK_NUMLOCK] := 1;    SetKeyboardState( keys );    sleep(100); end;

Döküman Arama

Başlık :

Kapat