Skip to content
/ hotkeys Public

A library to handle keybindings as event triggers

License

Notifications You must be signed in to change notification settings

tchesa/hotkeys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A library to handle keybindings as event triggers

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •