DescriptionHotkeys.js is a Prototype plugin for binding custom hotkeys and keyboard shortcuts.
FeaturesLightweight - 3.8 KB minified Cross-browser - Tested on Internet Explorer 6/7/8, Firefox 2/3, Google Chrome Browser-integrated It can bind and overwrite keyboard shortcuts already registered by the browser (like CTRL+S) When the focus is inside input fields or textareas it doesn't interfere UsageDownload hotkeys.js or hotkeys-min.js Include the script in your page, after the Prototype library:
Bind any combination of keys: Hotkeys.bind(combination, function, [param1, param2, etc]);You can call Hotkeys.bind() how many times you like, there is no limit to the number of hotkeys that can be registered, and binding can even be chained: Hotkeys.bind(combination, function).bind(anotherCombination, anotherFunction)[.bind(...];ExampleCalling a function that adds two numbers when pressing ALT+A together:
function add(a, b) {
alert(parseInt(a) + parseInt(b));
}
Hotkeys.bind("alt+a", add, 3, 4);Key aliasesThis is the entire list of available keys:
backspace tab enter shift ctrl alt pause caps esc pgup, pgdown end home left up right down ins del from 0 to 9 from a to z left-win, right-win - Win keys select num0 to num9 multiply, add, subtract, dec, divide f1 to f12 num - Num lock scroll - Scroll lock semi-colon equal comma dash period slash grave open-bracket backslash close-braket single-quote
30 Day Summary Apr 18 2013 — May 18 2013
|
12 Month Summary May 18 2012 — May 18 2013
|
Copyright
©
2013
Black Duck Software, Inc.
and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a
Creative Commons Attribution 3.0 Unported License
. Ohloh
®
and the Ohloh logo are trademarks of
Black Duck Software, Inc.
in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.