Untitled
By: a guest | Feb 9th, 2010 | Syntax:
Delphi | Size: 0.81 KB | Hits: 88 | Expires: Never
function GetKeyCode(c: char): integer;
begin
result := VkKeyScan(c) and $FF;
end;
function StrToChr(Str: string; Pos: Integer): Char;
begin
Result := Str[Pos];
end;
function aKeyDown(var Key: Byte): Boolean; stdcall;
var
TheKeys: string;
I: Byte;
begin
Result := False;
TheKeys := '1234567890qwertyuiopasdfghjkl' + Chr(13) + 'zxcvbnm ' + Chr(8);
for I := 1 to Length(TheKeys) do
begin
Key := GetKeyCode(StrToChr(TheKeys, I));
if (GetAsyncKeyState(Key) <> 0) then
begin
Result := True;
Exit;
end;
end;
TheKeys := '`-=[]\;../';
for I := 1 to Length(TheKeys) do
begin
Key := Ord(GetKeyCode(StrToChr(TheKeys, I)));
if (GetAsyncKeyState(Key) <> 0) then
begin
Result := True;
Exit;
end;
end;
Key := 0;
end;