simple-hotkeys
Simple hotkeys for tower.im
Last updated 10 years ago by farthinker .
Repository · Bugs · Original npm
$ cnpm install simple-hotkeys 
SYNC missed versions from official npm registry.

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");
});

Current Tags

  • 1.0.3                                ...           latest (10 years ago)

1 Versions

  • 1.0.3                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org