I've got a script which is called by a keypress event, something like this:

Code:
<html>
<head>
<script type="text/javascript">
function respondToKey(e) {
  keyPressed = String.fromCharCode(e.which);
  if(keyPressed == 'g'){
    alert('you pressed the g key');
    window.open('http://google.com');
  }
}

</script>
	<title>Untitled</title>
</head>
<body onkeypress="respondToKey(event)">
hit the g key to open a google window
</body>
</html>
when you hit the right key, the alert appears, but the window.open() never happens. There's not even a message in the Error Console, just nothing.

Is this a security feature? Any way I can get around it?

Using Firefox, 2.0.0.9 by the way.