Nomentsoa Andrianjatovo Nomentsoa Andrianjatovo - 1 year ago 83
Javascript Question

Javascript - CTRL+Alt+E keydown detection does not work on Firefox 48 and above

At the moment I post this, Firefox is at 49.0.2 version but the bug began to appear since the version 48. I tried a vanilla JS detection, didn't work:

document.addEventListener ("keydown", function (zEvent) {
if (zEvent.ctrlKey && zEvent.altKey && zEvent.code === "KeyE") {
alert("CTRL+Alt+E pressed!");

I tried Mootools-More detection, didn't work:

var myKeyboard = new Keyboard({
defaultEventType: 'keydown',
events: {
'ctrl+alt+e': toggleTopbar
function toggleTopbar() {
alert("CTRL+Alt+E pressed!");

Didn't try jQuery though.

Fiddle: Detecting combination keypresses (Control, Alt, Shift)? (credits to Brock Adams)

Side note: Also, in the fiddle above,
always returns the english keys even if you are on an AZERTY keyboard (french keyboard). Maybe the bug is only on AZERTY keyboards (who knows), but I didn't have any other keyboards.

What is the right code to make it work on Firefox ?

Answer Source

Now works on version 50.0 of Firefox, a month later.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download