About jquery in event.keyCode and event.ctrlKey shortcuts and prevent conflict

In the keydown event, event.which return ASCII code

         event.ctrlKey return boolean

$(document).keydown(function(event){

  var ctrl = event.ctrlKey; // If you click the Ctrl key, ctrl is true

  switch(event.keyCode){};       

  return false; // returns false to prevent conflict shortcuts

}) // keydown can only pass a key

Guess you like

Origin www.cnblogs.com/zhihaochow/p/11222013.html