title: Manually trigger an event on window object
body: <p>I am adding a listener like so:</p>
  
  <pre><code>    window.addEventListener('native.showkeyboard', function (e) {
          ...
          ...
      });
  </code></pre>
  
  <p>I'm writing a unit test for this so I want to trigger the event. Im doing:</p>
  
  <pre><code>    window.trigger('native.showkeyboard');
  </code></pre>
  
  <p>But I end up with an error for that line saying:</p>
  
  <pre><code>    undefined is not a function
  </code></pre>
  
  <p>How can I manually trigger this event?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have also tried:</p>
  
  <pre><code>  $(window).trigger('native.showkeyboard');
  </code></pre>
  
  <p>but the handler doesnt run with this as it's not registered with jquery...</p>