title: iPad Bluetooth keyboard returns keycode of 0 for any key with onKeyUp
body: <p>Some clients have been reporting issues when using their iPad Bluetooth keyboards for entering text into one of our internal sites. Mainly pressing enter on a certain input would work fine when using desktop or the iPad on screen keyboard, but not when using a Bluetooth keyboard connected to the iPad. </p>
  
  <p>Upon investigation it appears that any input to an <code>onKeyUp</code> returns 0 as the keycode when connected to a Bluetooth keyboard on the iPad. The demo works fine, however when using the onscreen keyboard it doesn't work because of the keycode returning 0. <a href="https://jsfiddle.net/f07dbxj9/" rel="nofollow noreferrer">I created this jsFiddle to demonstrate.</a> It was tested on both Chrome and Safari for iPad with the same results of working fine with <code>onKeyPress</code> but returning only 0 with <code>onKeyUp</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#inputKeyUp').keyup(function (event){
   $("#outputKeyUp").text("Key Up Key: " + event.which);
  });
  
  $('#inputKeyPress').keypress(function (event){
   $("#outputKeyPress").text("Key Press Key: " + event.which);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;textarea id="inputKeyUp"&gt;keyup&lt;/textarea&gt;
  &lt;div id="outputKeyUp"&gt;Key Up Key:&lt;/div&gt;
  &lt;b/&gt;
  &lt;textarea id="inputKeyPress"&gt;keypress&lt;/textarea&gt;
  &lt;div id="outputKeyPress"&gt;Key Press Key:&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>EDIT: just reported the bug to Apple. We will see if anything comes of it.</p>