title: How to simulate a key press by pressing a different key
body: <p>I want to hide the "suggested" options list that appears underneath the search input when you start typing something on the Wordpress search plugin, what I need specifically is to fire the "Escape" key event when I press down the "Delete" key, I tried the following jquery function but it doesn't work as I expected.</p>
  
  <pre><code>$('form.search-form').keydown(function (e) {
  
  // keycode for Delete key
  if (e.keyCode == 46) {
        var a = $.Event("keydown");
        // keycode for Esc key
        a.which = 27;
        a.keyCode = 27;
        $(document).trigger(a); 
  }});
  </code></pre>
  
  <p>Any help? Thanks in advance</p>