I am subclassing mx.modules.Module and I can listen to keyboard events
if I stage.focus = this; in the Event.ADDED_TO_STAGE handler but I
can't figure out how to always receive keyboard events.  

at the end of the constructor...

                addEventListener(Event.ADDED_TO_STAGE, stageListener);
        }
                
        private function stageListener(event:Event):void {
//                      stage.focus = this;
                        stage.addEventListener(KeyboardEvent.KEY_DOWN, 
this.pressed);

...


pressed() is not getting called unless I uncomment stage.focus = this;

How do I trap keyboard events all the time?



Reply via email to