Kapil
7/17/2018 - 6:22 AM

on clicking keyboard keys moustrap

creating event on clicking a keyboard keys

  
  // on pressing ctrl+f
   Mousetrap.bind(['command+f', 'ctrl+f'], function(e) {
    
    // code
     return false;  
  });
  
  use esc for escape key
  Mousetrap.bind(['esc'], function(e) 
  
  
  <script src="//cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.min.js"></script>