title: Firefox not detecting Alt key on keydown
body: <p>Firefox on Windows 10 does not detect the <kbd>Alt</kbd> key on <code>keydown</code> in conjunction with another key, but does detect the <kbd>Shift</kbd> key. Chrome and Edge detect both as expected.</p>
  <p>In Firefox, the following snippet shows that <code>event.shiftKey</code> is detected correctly, but <code>event.altKey</code> is never detected. In Chrome and Edge, <code>event.altKey</code> is detected correctly. (Pressing <kbd>Alt</kbd> or <kbd>Shift</kbd> triggers <code>keydown</code> in Chrome and Edge, but not in Firefox, which is why I said &quot;in conjunction with another key.&quot;)</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-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;&lt;/head&gt;
  
  &lt;body&gt;&lt;/body&gt;
  
  &lt;script&gt;
    document.addEventListener("keydown", function(event) {
      console.log("Alt: " + event.altKey);
      console.log("Shift: " + event.shiftKey);
    }, false);
  &lt;/script&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://stackoverflow.com/questions/58014379/mozilla-firefox-version-69-0-alt-key-event-not-being-detected">A question from 2019</a> reports the same problem in Firefox 69, but the solution was apparently that in Firefox, <code>&amp;&amp;</code> breaks something when used to detect if multiple keys including <kbd>Alt</kbd> are being pressed.</p>
  <p><a href="https://stackoverflow.com/questions/25952260/event-altkey-not-working-in-chrome-and-ie">A question from 2012</a> reports the same problem in Chrome, with the answer being that pressing <kbd>Alt</kbd> in Chrome enables the window menu, so the page loses focus and the <code>keypress</code> event is not called. Something similar could be going on in Firefox, because if the Menu Bar is enabled in Firefox, pressing <kbd>Alt</kbd> opens the first item (File) of the Menu Bar. However, the answer to that question says that &quot;keydown&quot; <em>does</em> work.</p>
  <p>I'm using Firefox 93.0 on Windows 10. I tried opening Firefox in Troubleshoot Mode (as I have Firefox configured extensively) but the problem persisted.</p>
  <p>Any help would be appreciated!</p>
  <p>Edit: It appears that this was caused by <code>privacy.resistFingerprinting</code> in <code>about:config</code>.</p>