title: How i can implement a IsKeyPressed function in a delphi console application?
body: <p>I have a delphi console application which i need terminate when the user press any key, the problem is which i don't know how implement a function to detect when a key is pressed , i want to do something like so.</p>
  
  <pre><code>{$APPTYPE CONSOLE}
  
  begin
   MyTask:=MyTask.Create;
   try
   MyTask.RunIt; 
    while MyTask.Running and not IsKeyPressed do //how i can implement a IsKeyPressed  function?
      MyTask.SendSignal($56100AA);
   finally
     MyTask.Stop;
     MyTask.Free;
   end;
  </code></pre>
  
  <p>end.</p>