Recent Posts
None | 12 sec ago
C | 13 sec ago
Ruby | 40 sec ago
None | 45 sec ago
None | 51 sec ago
None | 54 sec ago
Bash | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 10th of Feb 2010 12:28:34 AM Download | Raw | Embed | Report
  1. function GetKeyCode(c: char): integer;
  2. begin
  3.   result := VkKeyScan(c) and $FF;
  4. end;
  5.  
  6. function StrToChr(Str: string; Pos: Integer): Char;
  7. begin
  8.   Result := Str[Pos];
  9. end;
  10.  
  11. function aKeyDown(var Key: Byte): Boolean; stdcall;
  12. var
  13.   TheKeys: string;
  14.   I: Byte;
  15. begin
  16.   Result := False;
  17.   TheKeys := '1234567890qwertyuiopasdfghjkl' + Chr(13) + 'zxcvbnm ' + Chr(8);
  18.   for I := 1 to Length(TheKeys) do
  19.   begin
  20.     Key := GetKeyCode(StrToChr(TheKeys, I));
  21.     if (GetAsyncKeyState(Key) <> 0) then
  22.     begin
  23.       Result := True;
  24.       Exit;
  25.     end;
  26.   end;
  27.   TheKeys := '`-=[]\;../';
  28.   for I := 1 to Length(TheKeys) do
  29.   begin
  30.     Key := Ord(GetKeyCode(StrToChr(TheKeys, I)));
  31.     if (GetAsyncKeyState(Key) <> 0) then
  32.     begin
  33.       Result := True;
  34.       Exit;
  35.     end;
  36.   end;
  37.   Key := 0;
  38. end;
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: