Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 723 Bytes

readme.md

File metadata and controls

40 lines (27 loc) · 723 Bytes

Unchained UI

Keys

NPM Version NPM Downloads

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