title: Changing the default modal result of a form.showModal
body: <p>In my Delphi application I have a custom Yes, No, Cancel dialogue, which will be called from the main form to confirm saving the changes made to the current file edited. This would normally be achieved by messageDlg() but I wanted this dialogue to have customised looks, so I am trying to achieve this functionality by </p>
  
  <pre><code>case myDialogue.showModal of
    mrYes: &lt;&lt;save changes&gt;&gt;;
    mrNo: &lt;&lt;quit application without saving changes&gt;&gt;
    mrCancel: &lt;&lt;set the closeAction to caNone and do nothing&gt;&gt;
  end;
  </code></pre>
  
  <p>The problem is that, by default, the form reacts to pressing the Escape key by returning <em>mrNo</em> <code>TModalResult</code>. And you can see how BAAAD this is, since your intuition tells you that Esc-aping the modal dialogue will CANCEL the intended Quit Application process, but in fact what happens is you issue a <em>Don't save any changes</em> command and application quits.</p>
  
  <p>I have not noticed this behaviour until I lost an hour's work in this fashion. No FormKeyPressed event handler or <em>anything</em> responding to key presses was put into the myModalDialogue code. It just so works that pressing the Esc in forms shown using <code>showModal</code> will return <code>mrNo</code>. How can I override this default behaviour?</p>