R
Robert Inder
I am struggling to catch kestrokes within an Internet Explorer 6 window.
My window happens to be displaying three frames, though I suspect a
similar problem would arise with a single document.
The "<body.." tag in each frame includes an "onKeyPress" handler to
catch and act on key presses. And if I focus the window by clicking
on the content of one of the documents, keystrokes are sent to the
handler on its "<body..." tag.
BUT...
If I focus the window by clicking somewhere that does not have any
document content, the window gets focus, but key strokes just
disappear --- they are not caught by any of the "onKeyPress" event
handlers.
And in particular, when I first open the browser window (from
Javascript in another window), and focus it with window.focus(),
the window gets focus (is exposed, changes border etc.), but the
keystrokes are not caught by the "onKeyPress" event handler on the
"body" of any of the documents within it.
So what's the trick? How can I catch all the key strokes in a window,
not just within the body of the document?
Is there a standard way to do this?
Robert.
My window happens to be displaying three frames, though I suspect a
similar problem would arise with a single document.
The "<body.." tag in each frame includes an "onKeyPress" handler to
catch and act on key presses. And if I focus the window by clicking
on the content of one of the documents, keystrokes are sent to the
handler on its "<body..." tag.
BUT...
If I focus the window by clicking somewhere that does not have any
document content, the window gets focus, but key strokes just
disappear --- they are not caught by any of the "onKeyPress" event
handlers.
And in particular, when I first open the browser window (from
Javascript in another window), and focus it with window.focus(),
the window gets focus (is exposed, changes border etc.), but the
keystrokes are not caught by the "onKeyPress" event handler on the
"body" of any of the documents within it.
So what's the trick? How can I catch all the key strokes in a window,
not just within the body of the document?
Is there a standard way to do this?
Robert.