@tchesa/hotkeys

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i @tchesa/hotkeys

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

8.92 kB

Total Files

10

Last publish

Collaborators

  • tchesa