title: Trying to prevent a dead key from being typed from a Mac keyboard
body: <p>I'm trying to create a shortcut using the combo <kbd>alt</kbd>+<kbd>i</kbd>, which normally types a dead key <kbd>ˆ</kbd>, I tried the following: </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>$(document).ready(function () {
      $("#txtInput").keydown(
         function (event) {
             if (event.which == 229 &amp;&amp; event.altKey === true) {
                 alert(event);
                 event.preventDefault();
                 event.stopPropagation();
             }
         }
     ); 
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input id="txtInput" type="text" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The code inside the condition executes, but <kbd>ˆ</kbd> is still typed in my <code>"#txtInput"</code>.
  Is it possible to prevent this text from being typed?</p>