Skip to content

unchainedui/keys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Hotkeys detection & defenition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published