Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
Firefox not detecting Alt key on keydown

Firefox on Windows 10 does not detect the Alt key on keydown in conjunction with another key, but does detect the Shift key. Chrome and Edge detect both as expected.

In Firefox, the following snippet shows that event.shiftKey is detected correctly, but event.altKey is never detected. In Chrome and Edge, event.altKey is detected correctly. (Pressing Alt or Shift triggers keydown in Chrome and Edge, but not in Firefox, which is why I said "in conjunction with another key.")

<!doctype html>

<html>

<head></head>

<body></body>

<script>
  document.addEventListener("keydown", function(event) {
    console.log("Alt: " + event.altKey);
    console.log("Shift: " + event.shiftKey);
  }, false);
</script>

</html>

A question from 2019 reports the same problem in Firefox 69, but the solution was apparently that in Firefox, && breaks something when used to detect if multiple keys including Alt are being pressed.

A question from 2012 reports the same problem in Chrome, with the answer being that pressing Alt in Chrome enables the window menu, so the page loses focus and the keypress event is not called. Something similar could be going on in Firefox, because if the Menu Bar is enabled in Firefox, pressing Alt opens the first item (File) of the Menu Bar. However, the answer to that question says that "keydown" does work.

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.

Any help would be appreciated!

Edit: It appears that this was caused by privacy.resistFingerprinting in about:config.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!