Satellite: saving Home
[phoenix.git] / pages / hotkeys.textile
blob38dac85bc2a99778e6571f06205e2f2599e3811c
1 h3. "Javascript jQuery Hotkeys Plugin":http://code.google.com/p/js-hotkeys/
3 Cross Browser Module (Works with Safari, Opera, Firefox, Chrome and IE)
4 The latest Version is 0.7.8
6 bq. jQuery.Hotkeys plugin lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. It takes one line of code to bind/unbind a hot key combination.
7 h4. Example:
9 * Binding 'Ctrl+c'
10 {{{
11 $(document).bind('keydown', 'Ctrl+c', fn);
12 }}}
14 * Unbinding 'Ctrl+c'
15 {{{
16 $(document).unbind('keydown', 'Ctrl+c', fn);
17 }}}
19 h4. More info
20 * "Public Git Repository at GitHub":http://github.com/tzuryby/jquery.hotkeys/tree/master
21 * "Live Demo":http://jshotkeys.googlepages.com/test-static-01.html
22 * "Read More...":http://code.google.com/p/js-hotkeys/wiki/about
25 h3. Tips
26 * Textarea绑定hotkey
27 {{{
28 //content 是一个textarea对象的ID
29 jQuery.hotkeys.add('command+s', { target: jQuery("#content")[0] }, function(){jQuery('button:submit').click()})
30 }}}