Quelltext /~heha/hs/t_und_m.zip/SRC/WARPCURS.PAS

library warpcurs;
{$A+,B-,D+,F-,G+,I-,K+,L+,N-,P+,Q-,R-,S-,T+,V+,W-,X+,Y+}
{$C PRELOAD FIXED PERMANENT}
{$D Kursortasten beschleunigen, h#s 08/02}
{$R warpcurs}
uses WinProcs,WinTypes,Win31;
var
 Hook: HHook;
 KS: TKeyboardState;
 SaveSpeed: Word;
 WarpFactor: Word;
type
 LongRec=record
  lo,hi: Word;
 end;

function KeyboardProc(code: Integer; wParam:Word; lParam:LongInt):
  LongInt; export;
 var
  lPar: LongRec absolute lParam;
 begin
  if (code>=0)
  and (wParam in [VK_Left, VK_Right, VK_Up, VK_Down]) then begin
   if lPar.hi and $8000 =0 then begin		{Drcken}
    if lPar.hi and $4000 =0 then begin		{Taste war nicht gedrckt?}
     SystemParametersInfo(SPI_GetKeyboardSpeed,0,@SaveSpeed,0);
     SystemParametersInfo(SPI_SetKeyboardSpeed,SaveSpeed*WarpFactor,nil,0);
    end;
   end else begin				{Loslassen}
    SystemParametersInfo(SPI_SetKeyboardSpeed,SaveSpeed,nil,0);
   end;
  end;
  KeyboardProc:=CallNextHookEx(Hook,code,wParam,lParam);
 end;

procedure WEP;
 begin
  UnhookWindowsHookEx(Hook);
 end;

begin
 WarpFactor:=GetProfileInt('Windows','WarpCursorKey',3);
 Hook:=SetWindowsHookEx(WH_Keyboard,KeyboardProc,HInstance,0);
end.
Vorgefundene Kodierung: UTF-80