1.0.3 • Published 4 years ago

@tchesa/hotkeys v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

hotkeys npm version

A javascript library to handle keybindings as event triggers

Install:

  • yarn add @tchesa/hotkeys
  • npm install --save @tchesa/hotkeys

Example:

  import Hotkeys from '@tchesa/hotkeys'
  const hotkeys = new Hotkeys()

  const action = () => {
    console.log('this is my action')
  }

  hotkeys.on('ctrl+c', action) // register an action

Removing the action:

  hotkeys.off('ctrl+c', action) // removing added action