I want to get a pressed mouse or keyboard button from global object window or document when it's listening in setInterval.
setInterval(function () {
window.mouse.button. ...;
window.keyboard.button. ...;
// or maybe
document.mouse.button. ...;
document.keyboard.button. ...;
}, 1);
It would be kind of my own self-made event.
How to detect a pressed button using setInterval and without any event in javascript?
setInterval(function () {
window.mouse.button. ...;
window.keyboard.button. ...;
// or maybe
document.mouse.button. ...;
document.keyboard.button. ...;
}, 1);