I'm trying to embed some keybindings in my webapp, and I'm having hard times with Opera. I have this code:
window.onkeydown = function(e){
var key = e.keyCode ? e.keyCode : e.charCode ? e.charCode : false;
if (e.ctrlKey && key === 84) {
alert("foo");
e.preventDefault();
// return false;
}
}
It works like a charm in Firefox and Chrome, but Opera still opens new tab. Same happens with return false;
.
My info: Opera/9.80 (X11; Linux i686; U; en) Presto/2.7.62 Version/11.00