Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top