Frage

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...

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top