+1  A: 

I imagine the Flash movie is handling the key events and preventing them propagating up the document tree. Why not handle the events in the Flash itself?

Tim Down
I can't do things like CMD-Q/CTRL-Q in Flash, it will close the Browser :/. I can hear all the keyboard events Flash, but not in the document.... any other ideas?
viatropos
+1  A: 

Are you sure Flash is not blocking it? Have you tried to run your code on a page without Flash on it?

You should try attaching the events to window and not document

epascarello
I tried both, "window" and "document", they both work the same. To compound it, it only works on Safari, Firefox doesn't register anything.
viatropos
how would flash be blocking it? is there a way around that?
viatropos
Have you created a page with just the event handling on it and nothing else? Get it working without anything on the page and add stuff one at a time until it breaks.
epascarello
+2  A: 

Like Tim, I guess Flash/Flex is swallowing the key events. Since Alt etc are Meta Keys, they don't fire a keypress event in Flex and are passed to JS. On the other hand, certain gestures (e.g. Ctrl+A on some browsers) are prevented to be ever received by Flash. I imagine, that for the same reason (security) these are also prevented from beeing handled by JS. Which key gestures are protected is highly browser dependend.

Probably the browser won't allow you to handle CTRL-Q so that the user can always close his browser, even when having some malicous sites open.

Jörg Reichardt
that makes sense. thanks.
viatropos