Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
Advertisement
Add Comment
Please, Sign In to add comment