AS3 capture keypress regardless of the current focus?
When I add a keypress event listener to the stage, it does not fire when the focus is on another object. How can I listen for any keypress event regardless of the focus?
Just setting the useCapture
parameter to true
does not work . I think it's because no event is bubbled up if I do not add a listener to every object on the stage.
Do I really have to add an eventlist开发者_运维问答ener to every object to capture a keypress event regardless of the current focused object?
I think if you add your keyEventListener to the stage and then in functions where the focus is changed add the code:
stage.focus = stage
it might work.
精彩评论