Javascript IFrame/designmode and onkeydown event question
<p>Apologize if this is answered already.  Went through some of the related questions and google, but ultimately failed to see why this isn't working.</p>

<p>My code is as follows</p>

<pre><code>&lt;iframe id="editor"&gt;&lt;/iframe&gt;

editorWindow = document.getElementById('editor').contentWindow;
isCtrlDown = false;

function loadEditor()
{
    editorWindow.document.designMode = "on";
    editorWindow.document.onkeyup = function(e) {
        if (e.which == 91) isCtrlDown = false;
    }
    editorWindow.document.onkeydown = handleKeyDown;
}

function handleKeyDown(e)
{
    if (e.which == 91) isCtrlDown = true;
    if (e.which == 66 &amp;&amp; isCtrlDown) editFont('bold');
    if (e.which == 73 &amp;&amp; isCtrlDown) editFont('italic');
}

function editFont(a,b)
{
    editorWindow.document.execCommand(a,false,b);
    editorWindow.focus();
}
</code></pre>

<p>This code works perfectly in Chrome, but the keyboard shortcuts do not work in Firefox.  In fact, in Firefox it does not seem to register the events for keyup/keydown at all.</p>

<p>Am I doing something grossly wrong here that is mucking up Firefox?</p>
