title-shortcut-handler

1.0.0 • Public • Published

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();

/title-shortcut-handler/

    Package Sidebar

    Install

    npm i title-shortcut-handler

    Weekly Downloads

    4

    Version

    1.0.0

    License

    none

    Last publish

    Collaborators

    • brian-c