Results 1 to 6 of 6

Thread: Simple unblocked readkey.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Simple unblocked readkey.

    function getKey : Smallint;
    var ch : Byte;
    begin
    if keypressed then begin
    ch := Ord(readKey);
    if ch = 0 then getKey := 1000 + Ord(readKey)
    else getKey := ch;
    end else getKey := -1;
    End;

    Pretty smart. I found it online and it works great. Returns -1 if no key pressed. and 1000+scancode or ascii value. It really helps clean up the main program alot!
    Last edited by sixten; 16-05-2012 at 10:00 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •