I am using code to make the spacebar do something for an HTML 5 game. It works great, but the page that displays the game also has a Search Box, and visitors will not be able to use the spacebar properly in the Search Box on that page.

Below is the the code I am using for the spacebar on the game's page.

The Search Box is input type search, so I was wondering if a function could be make for :search, to revert the spacebar to work correctly inside the Search Box.

```
var hit = document.getElementById("hit");

document.onkeydown = function(e) 
{
    if (e.keyCode == 32) 
    {
        e.preventDefault();
        hit.click();
    }
};

```

thanks