문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top