ComboKeys Context

This is a light wrapper about ComboKeys that provides context aware key
bindings.
Compatibility
Tested against the latest version of Google Chrome, latest Firefox, and Internet Explorer 10 and 11. Should work with all
browsers that works with ComboKeys as long as Object.keys
is polyfilled where needed.
Install
npm install combokeys-context
Documentation
Full Usage
var ComboKeys = require('combokeys');
var ComboKeysContext = require('combokeys-context');
var comboKeys = new ComboKeys(document);
var comboKeysContext = new ComboKeysContext(comboKeys);
var callbackGlobal = function(evt, key) {
console.log('Global: ' + key);
}
var callbackContext = function(evt, key) {
console.log('Context A: ' + key);
}
comboKeysContext.bind('alt+a', callback);
comboKeysContext.bind('alt+b', callback);
comboKeysContext.bind('alt+b', 'contextA', callback);
comboKeysContext.switchContext('contextA');
comboKeysContext.clearContext();
comboKeysContext.unbind('alt+b');
comboKeysContext.unbind('alt+b', 'contextA');
comboKeysContext.unbindAll('alt+b');
comboKeysContext.reset();
Full API Docs
ComboKeys Context JSDocs
License
Combokeys Context is released under the MIT license. See LICENSE.