3 ms·
You can attach an event to the window or some other higher-level element and check if event.target is an input field... something along the lines of: docum
by renekooi 13y ago
You can attach an event to the window or some other higher-level element and check if event.target is an input field... something along the lines of:
document.body.addEventListener('keydown', function(e) {
if (e.target.tagName !== 'INPUT') doKeyBindings();
}, false);