|
IIRC, the docs have been updated for this.
Have you tried adding the listener to all keydown events on the stage? Like
this: stage.addEventListener(KeyboardEvent.KEY_DOWN,
myHandler) BTW, you can always set focus
programmatically using the UIComponent’s setFocus() method. hth, matt horn flex docs From: I'm trying to capture
global keyboard events so I can implement keyboard shortcuts in my app.
Let's say it's an email app and as soon as it loads you want to press CTRL+M to
show a "New Message" popup. The docs on handling keyboard
events make it sound like this is possible, but the sample code provided
doesn't work unless you set focus by clicking on a button (or list item, or
textInput, etc) in your app first. Clicking a Canvas isn't enough.
Is there a good way to handle these events without making the user click on
something first? Can a Canvas have focus? Can I programatically
assign focus? |
- [flexcoders] F2B3 -- global keyboard event capture, prob... Tom Bray
- RE: [flexcoders] F2B3 -- global keyboard event capt... Matt Horn
- RE: [flexcoders] F2B3 -- global keyboard event capt... Pablo Apanasionek

