title: How to pause program execution until button press?
body: <p>I've got an algorithm. I'd like to pause it at some point and then continue once the user presses a button. How do I do that? I've browsed the documentation, and searched the internet, but no luck yet.</p>
  
  <p>Here's a relevant code snip:</p>
  
  <pre><code>      if A[i]&gt;A[i+1]
          then
            begin
              Zameni(i,i+1);
              done:=true;
  
              sleep(pauza);
  
              br:=br+1;
            end;
  </code></pre>
  
  <p>Right now, I use sleep (pauza is just a constant, means pause in Serbian). Ideally, I'd like to replace that line with a procedure which would sleep for the interval, or wait for a button press based on a configuration setting.</p>
  
  <p>EDIT1: Ah yes, if it wasn't obvious - it's a graphics application, not console, so slapping a "readln" won't work (sadly). </p>