1.0.0 • Published 8 years ago

title-shortcut-handler v1.0.0

Weekly downloads
9
License
-
Repository
-
Last release
8 years ago

Assign keyboard shortcuts to elements.

Clickable things get clicked.

Focusable things get focused.

<!--Add in brackets to the end of the title:-->
<a href="/info" title="Get information [I]">Info</button><br />

<!--Or in its own attribute to keep it hidden:-->
<input type="text" placeholder="Hit 'ESC' to focus." data-shortcut="ESC" /><br />

<!--Use "META-", "CTRL-", "ALT-", and "SHIFT-" modifiers:-->
<button type="button" title="Select this item [ALT-SHIFT-X]">Select</button>
// To start listening:
var shortcutHandler = new TitleShortcutHandler();

// And to stop:
shortcutHandler.destroy();