title: How to disable Escape Key for Twitter Bootstrap Modals?
body: <p>In a shown modal there is a form. If I focus on an input field (any field for that matter) and press ESC key, that modal is hidden. However, if I don't focus on a form field, then pressing ESC key does not close the modal. What's going on?</p>
  
  <p>I want to disable ESC key functionality for the modals altogether. I tried this:</p>
  
  <pre><code>$(document).on('keypress', function(e) {
    if(e.keyCode == 27) {
      e.preventDefault();
      return false;
    }
  }
  </code></pre>
  
  <p>But this does not affect anything. Is there a way to completely disable ESC key for modals?</p>