Key command
Add keyboard shortcuts to links.
Basic Usage (HTML)
data-jkit="[key:code=shift+up]"
Advanced Init (JavaScript)
$('#myelement').jKit('key', { 'code': 'shift+up' });
Options
Option | Values | Default | Description |
---|---|---|---|
code | String | The keycode to trigger the elements target or onclick attribute | |
macro | Macro name | This optional macro will be applied to the element after the key was pressed |
Events
Event | Description |
---|---|
pressed | Triggered after keypress |
Examples
Basic demos:
Control links with your keyboard by adding keyboard shortcuts to them:
Source:
<ul> <li><a href="#anchor_options" data-jkit="[key:code=shift+up]">Move to the options with key combo "shift+up"</a></li> <li><a href="http://fredibach.ch" target="_blank" data-jkit="[key:code=alt+shift+o]">Open a website in a blank window with "alt+shift+o"</a></li> <li><a href="#" onclick="alert('test')" data-jkit="[key:code=ctrl+shift+a]">Open an onclick alert with "ctrl+shift+a"</a></li> <li><a href="#" onclick="alert('f3 pressed')" data-jkit="[key:code=f3]">Open an onclick alert with "f3"</a></li> </ul>
Replacements
There are currently no replacements for this command.
[ Learn more about replacements ]
Discussions
Do you have questions or do you want to suggest new features? Than head over to our new community:
[ jKit Community ]