Licence
MIT
Version
1.0.0
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Unchained UI
Keys
Hotkeys detection & defenition
ES module version of is-hotkey
Usage
import isHotkey from 'uc-keys';
function onKeyDown(e) {
if (isHotkey('mod+s', e)) {
...
}
}
For better perfomance you can curry the hotkey:
import isHotkey from 'uc-keys'
const isSaveHotkey = isHotkey('mod+s')
function onKeyDown(e) {
if (isSaveHotkey(e)) {
...
}
}
License MIT
Ian Storm Taylor