Hi
Chapter 8 of specification gives the larger picture of Event Processing.
It says that user events are fist processed by the script and after that markup gets chance to process the event.
eg if a user presses a navigation key then first the script (through event handlers ..if one is regestered ) first processes the gesture and after that (if allowed by script) the markup processes the gesture --changes the focus to the next element (depending on the navigation key).
If the above is correct then this means the target for the keyboard events is always the current focused element.
One exception might be access ( or shortcut) keys in which case the target is the element for which the short key is defined. ie script cannot override the accesskeys or can it
Thanks

Event Target
mitasid
Another question :)
7.5 also says
the focused app also changes as the user navigates the focus out of it and into an element in a different application.
7.2.8.2 says
the focused app's body element has state:foreground as "true".
7.6.3.4.2.1 says
Foreground is set to true ...whenever app is front-most app in z-order (highest z-order ).
This all seems to imply that as an application gains focus it also becomes the highest z-order app ie z-order changes to highest.
jcoburn
This is covered in Z.5.3. The event is sent to the focused node, unless:
Since the focus doesn't change until after script handles the event, the "focused" node will be the one that had the focus before you hit the key.
You can cancel accessKey events via preventDefault() (and the above is still true -- since handling of accessKey is part of the default handler, and the default handler runs after any script has run, the old element still has the focus).
albidochon
Are these assumptions correct :
the current focused element(if any ) would always be in the highest z-ordered app and vice versa.
If there are 5 applications opened then for every user event ie mouse ans keyboard the event processing wll start from the topmost...highest zorder app...
for mouse :
--- suppose mouse is in a lower z-ordered app.
the mouse event would be handled by all the app on whose elements the mouse currently is (either directly or indirectly ie overlapping apps ) and not by any other app.
ie it will not depend on z-order
event taregt would be the element on the app(which is processing the event).
The element may not have mouse directly over it....overlapping apps.
for keyboard:
---if there is a focused element : that would be on the highest z-order app
only by the app having the focused element will process the event.
event target will be focused element.
---if there is no focused element
by all apps starting from the highest z-order app
event target would be each app.
Thanks
sqlduck
Why do I I feel like I am back in college again :-)
The focused element isn't necessarily in the highest z-order application, although if nobody has the focus then the highest app gets keystrokes first (see explanation in 7.2.5).
Mouse gestures ONLY go to the application with the element that is highest in the z-order underneath the cursor; it won't go to elements underneath it (7.2.8.4).
Andrey Makarov
I don't have the spec with me at home, but I imagine that means that if you move the application with moveToTop() (or whatever the API is called), it automatically becomes focused. But being focused doesn't move you to to the top. Just like saying "all apples are green" doesn't mean "all green things are apples".
Also, there is a description (I think in Chapter 8) that shows how events flow; the focused application gets events first, even if it isn't at the top of the z-order, and then the event goes through each app in z-order order, skipping the focused app along the way. So the wording you see might be referencing that behaviour, too.
osama.jasser
And I think In MS Simulator if one preses a navigation key without focusing any element ( the event goes to application) and as part of default handling the first navigable element is focused.
is it right