Posted By

kashif21 on 04/27/11


Tagged

key with and of shift disable enable some ctrl there comibinations


Versions (?)

Enable and disable shift and ctrl key with some of there comibinations


 / Published in: JavaScript
 

  1. //diable shift key
  2.  
  3. e.ShiftKey = false;
  4.  
  5. //Enable shift key with ARROW key left(37) and right(39)
  6. if (e.shiftKey) {
  7.  
  8. if(e.keyCode == 37 || e.keyCode == 39)
  9. {
  10. return true;
  11. }
  12.  
  13. }
  14. //Enable Ctrl key with A (Ctrl+A)
  15. if (isCtrl == true && e.which == '65') { return true; }
  16. (for chrome)
  17. if (e.ctrlKey == true && e.keyCode == '65') { return true; }

Report this snippet  

You need to login to post a comment.