Add shortcut:
$.Shortcuts.add({ type: 'down', mask: 'Ctrl+A', handler: function() { debug('Ctrl+A'); } });
Start responding to shortcuts:
$.Shortcuts.start();
Add a shortcut to the "other" list:
$.Shortcuts.add({ type: 'hold', mask: 'Shift+Up', handler: function() { debug('Shift+Up'); }, list: 'another' });
Activate the "other" list:
$.Shortcuts.start('another'); Remove a shortcut: $.Shortcuts.remove({ type: 'hold', mask: 'Shift+Up', list: 'another' });
Stop (disable event handlers):
$.Shortcuts.stop();
Tutorial:
http://www.stepanreznikov.com/js-shortcuts/
KingRider Feb 25 '15 at 20:55 2015-02-25 20:55
source share