simple-hotkeys

1.0.3 • Public • Published

simple-hotkeys

Options

  • el - jQuery selector / jQuery Object / Node;

If you want to bind hotkeys to dynamic adding element, please pass a selector as el.
If the el is null or doesn't exist, document element would be used by default.

Api

  • add(shortcut, callback(e)) - add a hotkey.
  • remove(shortcut) - remove a hotkey
  • destroy() - off events and clean up.

Usage

hotkeys = simple.hotkeys();
hotkeys.add("ctrl + b", function(e){
    console.log("ctrl + b pressed");
}).add("ctrl + h"], function(e){
    console.log("Help");
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    541
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    541
  • 1.0.2
    5
  • 1.0.1
    2
  • 1.0.0
    2
  • 0.2.0
    2

Package Sidebar

Install

npm i simple-hotkeys

Weekly Downloads

552

Version

1.0.3

License

none

Last publish

Collaborators

  • farthinker