Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. (function($) {
  2.  
  3. var PluginName_KeyCapture = Garnish.Base.extend({
  4.  
  5. init: function()
  6. {
  7. this.addListener(Garnish.$doc, 'keydown', function(ev)
  8. {
  9. if ((ev.metaKey || ev.ctrlKey) && ev.keyCode == 66)
  10. {
  11. ev.preventDefault();
  12. console.log('You hit CTRL + B! Good work.');
  13. }
  14. });
  15. }
  16. });
  17.  
  18. Craft.PluginName_KeyCapture = new PluginName_KeyCapture();
  19. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement