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

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top