How to detect when shortcut key is pressed - ATL+F4?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Huu Loi
    New Member
    • Jan 2011
    • 1

    #1

    How to detect when shortcut key is pressed - ATL+F4?

    Hi,
    This will show you how to:
    Code:
    document.onkeydown = keydown;
    
    function keydown(evt){
      if (!evt) evt = event;
      if ( evt.altKey && evt.keyCode==115){ //CTRL+ALT+F4
        alert("ALT+F4"); 
      }
      else if (evt.shiftKey && evt.keyCode == 9){ //Shif+TAB
        alert("Shift+TAB");
      }
    }
    Last edited by Dormilich; Jan 20 '11, 07:28 AM. Reason: please use [code] [/code] tags when posting code
Working...