Pregunta

I'm doin an extension by hand, the old school way (without bootstrap, or whatever the new thing is called). I'm trying to figure out how to capture all keydown events, so as to make a new utility for custom keyboard shortcuts.

I already tried adding a window.addeventlistener to the main javascript, but that doesn't work, and i didn't think it would because there's multiple windows...

¿Fue útil?

Solución

I'm not sure why it didn't work for you, but i added:

window.addEventListener("keydown", function () { alert("keydown");}, true);

And it captures every keydown i make.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top