How to detect that Ctrl+R was pressed?

后端 未结 10 847
逝去的感伤
逝去的感伤 2020-12-08 14:27

I\'m coding a function in jquery that executes if Ctrl+R is pressed but I can\'t seem to find out what the left and right ctrl keycodes are... Can some

10条回答
  •  执笔经年
    2020-12-08 15:09

    The Key Code for Ctrl key is 11.

    $(document).keypress(function(e) { 
    
    
      alert("Ctrl is pressed: " + e.ctrlKey); 
    }); 
    

提交回复
热议问题