var message="Botón derecho inhabilitado"; //protect from right-click
var ctrlPressed=0; var altPressed=0; var shiftPressed=0; 

function click(mouse) {
  if (document.all) {
    if (event.button==2||event.button==3) {
      alert(message);
      return false;
    }
  }
  
  if (document.layers) {
    if (mouse.which == 3) {
      alert(message);
      return false;
    }
  }
}


if (document.layers) {
  document.captureEvents(Event.MouseDown); //protect from keyboard keypress
  
  function keypressed() {
      
    shiftPressed=event.shiftKey; 
    altPressed =event.altKey; 
    ctrlPressed =event.ctrlKey; 

    var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();
         
    if ( (event.ctrlKey ) && (pressedKey == "n" || pressedKey == "r" || pressedKey == "u" || 
        pressedKey == "w" || pressedKey == "i" ||  pressedKey == "1" ||
        pressedKey == "o" || pressedKey == "p" || pressedKey == "a" ||
        pressedKey == "h" || pressedKey == "e" || pressedKey == "c" || pressedKey == "v"))
        {
            alert("Teclas Inhabilitadas ");             
            return false;
        }
    else if( String.fromCharCode(event.keyCode) == "Ü" ) { /* Si es pipe | */
                          alert("Tecla invalida ");             
                          return false;
    }
    
  }
}

document.onmousedown=click;
document.onkeydown=keypressed;

