Arbitrary Hotkeys
jQuery plugin that allows you to set arbitrary hotkeys for hyperlinks in your HTML page.
Usage
- Download the script or get the link to the script with CDN here
- Import both jQuery and arbitrary-hotkeys.js in your HTML head, example:
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="js/arbitrary-hotkeys.js"></script>
- Create a HTML tag inside head named "hotkey" and list the hotkeys you want
in this form:
<hotkey key="your_hotkey" targetId="id_of_your_html_hyperlink"></hotkey>
(a HTML tag)
Example:
<hotkey key="git" targetId="github"></hotkey>
<hotkey key="goo" targetId="google"></hotkey>
For this example of hiperlink in HTML body:
<a id="google" href="https://plus.google.com">Google+</a>
<a id="github" href="https://github.com">GitHub</a>
- Enjoy!
An example of HTML document using arbitrary-hotkeys.js: Example
Troubleshooting
Arbitrary Hotkeys doesn't work with Ctrl, Alt and Shift buttons!
- Arbitrary Hotkeys was made for setting up keystrokes in web pages from strings, like "f", "ja", "trello" with usage inside user's HTML (not in a script), and it doesn't support modifiers.
License
Arbitrary Hotkeys is distributed under the terms of the MIT License. See the LICENSE file for details.
Bug tracker
Found a bug? Want to suggest a new feature or improvement? Let us know here on GitHub!
Authors
- Yuri Dias – https://www.linkedin.com/in/yuri-pereira-b5b589a8
- Gustavo Moraes – http://about.me/gustavosotnas
Arbitrary Hotkeys is reusing code by Christian Brassat and Jukka Svahn: https://github.com/crshd/startpage.rwrt/blob/master/js/script.js
Pull Request
Contributors are welcome! Issues - arbitrary-hotkeys