jQuery Plugin To Enable Custom Shortcuts On Your Website - Hotkey Event

File Size: 8.04 KB
Views Total: 2784
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Enable Custom Shortcuts On Your Website - Hotkey Event

Hotkey Event is a cross-platform jQuery plugin for defining (combo) keyboard shortcuts such as 'CONTROL+ALT+PLUS' and binding an event with it. 

Basic usage:

1. Include the jQuery hotkey event plugin after jQuery library.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/jquery.hotkey.js"></script>

2. Define a combo shortcut and execute a function as the hotkey event is triggered.

$(document).hotkey('alt+shift+esc', function(e){
  // do stuff...
});

3. Key names.

Full name Name Alias
Altername alt  
Option option opt,
Control ctrl control,
Shift shift
Command cmd cmd, command, ,
Windows windows win
Spacebar space  
Return return enter, ,
Caps Lock caps capital, capslock,
Escape esc escape,
Back Space backspace
Delete del delete,
Insert insert ins
Num Lock num numlock
Scroll Lock scroll scrolllock
Tab tab
Home home
End end
Page Up pageup
Pge Down pagedown
Arrow Up up
Arrow Down down
Arrow Left left
Arrow Right right
Hyper hyper alt+ctrl+shift
Informational f1...f12  
Plus plus  
Minus minus  

Change log:

v1.2.1 (2015-01-13)

  • Bug Fixes
  • Minor improvements

This awesome jQuery plugin is developed by koomootoz. For more Advanced Usages, please check the demo page or visit the official website.