Is there a way in Javascript to determine if no elements are in focus?
<p>I'm building some hotkeys into a page of my HTML:</p>

<pre><code>   $(document).bind('keypress', function (e) {
        var event = (e.keyCode ? e.keyCode : e.which);

        if (event == LETTER_P) {
            // go to another page
        }
    }
</code></pre>

<p>But the problem is that if they are entering text on the page (in a textbox element, etc) and hit the letter 'P', they are off to another page.  I only want the redirection to happen if they are not in any elements.</p>
