Try this code to reproduce the problem (only event fired will be printed in console with any key but ALT or CTRL, and others but I just need alt to work):
<!DOCTYPE html>
<html>
<body onkeypress="openTab(event);">
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<script> function openTab(e) {
console.log('event fired');
if (e.altKey) {
console.log('event alt key');
if (e.charCode == 114 || e.charCode == 82) {
console.log('event alt key plus R');
}
}
}
</script>
</body>
</html>
I though I was doing something wrong but I added a logger in the function and it prints with any key, I mean it works pressing any key but ALT, or CTRL, or SHIFT, I don't know if this is a problem with the version of mozilla.. or whats going on. Because when I press alt I don't get the event but the browser menu opens up, maybe there is a way to configure this?