Funkcjonalność tej witryny będzie ograniczona w czasie konserwacji. Jeśli artykuł nie rozwiązuje twojego problemu i chcesz zadać pytanie, to nasza społeczność wsparcia jest dostępna na @FirefoxSupport na Twitterze i /r/firefox na Reddicie.

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Więcej informacji

Keydown Event does not work for Control, Shift and Alt keys?

  • 4 odpowiedzi
  • 1 osoba ma ten problem
  • 7 wyświetleń
  • Ostatnia odpowiedź od Einhornyordle

more options

If you execute the following code in the browser's console

onkeydown = function(e){console.log(e);};

it should log every keypress to the console window, however, the event doesn't seem to fire when I press Control, Alt or Shift (by themselves, keycombos like Shift + W work). Trying the same in Edge for example works for every key, including the three mentioned. Am I doing something wrong or is this a bug of firefox? I should also mention that I'm using the developer edition of firefox.

If you execute the following code in the browser's console onkeydown = function(e){console.log(e);}; it should log every keypress to the console window, however, the event doesn't seem to fire when I press Control, Alt or Shift (by themselves, keycombos like Shift + W work). Trying the same in Edge for example works for every key, including the three mentioned. Am I doing something wrong or is this a bug of firefox? I should also mention that I'm using the developer edition of firefox.

Wszystkie odpowiedzi (4)

more options

It works for me in Nightly.

more options

You're right, it seems like it works on both, regular firefox and nightly, just not on the developer version. I guess I've to wait for an update of the developer version then and use any of the other ones in the meantime?

Zmodyfikowany przez Einhornyordle w dniu

more options

This is strange. May be a bug in dev-ed (so it will be solved n 4 weeks). I would also compare about:config entries beginning with dom.keyboardevent.*.

more options

dom.keyboardevent.* config entries are equal on all 3 editions, so that doesn't seem to be the problem. I guess I'll try again in a month or so.