(reposting from plug-in group)
Hi all,

Last night I rewrote (granted permissions by author) the module
shortcut.js (from http://www.openjs.com/scripts/events/keyboard_shortcuts/)
as a jQuery plug-in.

The syntax is simple:
hooking:
$.shortcut.add(<shortcut>, <options>, <callback>);

unhooking
$.shortcut.remove(<shortcut>);

for example:

$.shortcut.add("Ctrl+a", {propagate: true}, funcRef);

The default options are: {type: 'keydown', propagate: false,
disableInInput: false, target: document}

jQuery.shortcut.add("Ctrl+Shift+2", function(){return;});

jQuery.shortcut.add("Ctrl+2", {target: ':input'}, function(){ // do
something});

Stop hooking?

jQuery.shortcut.remove("Ctrl+2");

Browser Tests So Far:
IE7, FF 2, Opera 9.2

I am planning to add a test suite covers all the functionality in
order to make it easier with the testing.

Help is needed with Testing and Code Review.

You can download a pre alpha version from 
http://code.google.com/p/snippets-4-all/

Thank you for the jQuery,

Tzury Bar Yochay

[EMAIL PROTECTED]
http://evalinux.wordpress.com
facebook.com/profile.php?id=513676303

Reply via email to