-
KeyboardEvent Observer Without focus
I am trying to implement the Observer pattern for a keyBoardEvent class that handles the key events and notifies all subscribers (basically centralises the event handling and updates those that need to know)
New to Patterns and As3.0 and seems the
Code:
addEventListener(KeyboardEvent.KEY_DOWN)
requires the displayObject to have focus but if it loses it wont trigger...which makes sense.
However, there must be a way to force the class to listen for KeyBoardEvents regardless of focus? extedning the KeyBoordEvents Class prehaps?
Any pointer on this would be greatly appreciated
Cheers
Jon
-
You could add the listener to the stage instead.
-
Yes, but that still leaves the problem if another displayObject acquires the focus the class then cant track the keyboardEvents.
i need to bypass the focus restriction and track the Events from a global stand point....regradless of what has currently got the keyboard focus.
Hope that makes more sense?
Anyone any idea?
Thanks
JOn
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|