6 ms·
If you use this for hotkeys in your application make sure to return false or set e.handled to true or something like that. I don't remember the exact details ri
by Too 13y ago
If you use this for hotkeys in your application make sure to return false or set e.handled to true or something like that. I don't remember the exact details right now.
Otherwise features from the browser like "incremental search" in firefox will get priority over the key captures in your app. In fact both your key capture and the incremental search will trigger which is very frustrating as the page starts scrolling to the first match of the letter you just typed.
But be very careful while doing this. Only do it for for your own hotkeys and make sure they are not used for other hotkeys in most common browsers! If you always swallow the keypress, normal hotkeys like ctrl+t for new tab will stop working for the user also.