'Disabling Ctrl+T in web browsers

I'm stuck with a shortcut problem. Javascript is not a language I've used much, and the answers I've searched didn't help.

I'm creating some tutorials for a specific software, and some exercises need you to use specific shortcuts of said software. The code I put up together to do that was :

document.onkeydown=disableKeys;
var version = navigator.appVersion;

function disableKeys(e) 
{   var keycode = (window.event) ? event.keyCode : e.keyCode;

    if ((version.indexOf('MSIE') != -1)) 
    {  if (keycode != 0) 
       {  event.keyCode = 0;
          event.returnValue = false;
          return false;
       }
    }
    else 
    {  if (keycode != 0) 
          return false;
    }
}

It worked fine up until now, as I need the user to use Ctrl+T. This actually opens up a new tab despite the code being active. I also need this to work as universally as possible on every browsers. Does anyone have a solution to disable this shortcut ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source