Handling onKeyDown event: some keys are not caught
Posted on 2005-04-29
I need to watch some pressed keys inside MovieClip loaded in "Flash Player" hosted inside Web browser (Internet Explorer or Netscape). I had created listener for onKeyDown event:
var oLst:Object = new Object();
oLst.onKeyDown = onKeyDown;
Key.addListener( oLst );
trace( "'" + Key.getCode() + "'" );
Some keys are not caught by this one. For example, i need to process ESCAPE key, but this key is caught under Netscape and not caught under "Internet Explorer".
Why? And how to process ESCAPE in "Internet Explorer"?
The SWF used in Netscape and in IE is the same. And Action script is the same! I had moved event handler inside SWF instead of creating Java Script in HTML since onKeyDown event is not propagated to the HTML-elements when "Flash Player" has focus.