Pretraži podršku

Izbjegni prevare podrške. Nikad te nećemo tražiti da nas nazoveš, da nam pošalješ telefonski broj ili da podijeliš osobne podatke. Prijavi sumnjive radnje pomoću opcije „Prijavi zlouporabu”.

Saznaj više

Capture the shift key when pressed

  • 1 odgovor
  • 1 ima ovaj problem
  • 1 prikaz
  • Posljednji odgovor od codyb29

more options

I am writing a program that requires me to detect when a shift key is pressed and do something. Something like

window.addEventListener('keydown', event => console.log(event), false); // expect to see an event logged to console when pushing the "shift" key

This works great on all browsers except Firefox. "alt" and "fn" keys are also not able to be detected on Firefox. Is there some sort of advanced security settings I can disable to let me capture these things?

Thanks in advance.

I am writing a program that requires me to detect when a shift key is pressed and do something. Something like window.addEventListener('keydown', event => console.log(event), false); // expect to see an event logged to console when pushing the "shift" key This works great on all browsers except Firefox. "alt" and "fn" keys are also not able to be detected on Firefox. Is there some sort of advanced security settings I can disable to let me capture these things? Thanks in advance.

Svi odgovori (1)

more options

This is actually working on Windows. This could be a mac OS issue.