Documentation
    Preparing search index...

    Class SceneKeyEvent

    One key event travelling the scene graph (§72).

    Construct one directly when driving dispatchKeyEvent by hand (tests, synthetic input, a non-DOM key source); KeyboardInput constructs them for real keystrokes. SceneInputEvent supplies target, propagationStopped, and stopPropagation.

    Hierarchy (View Summary)

    Index
    code: string

    See SceneKeyEventInit.code — the physical key.

    key: string

    See SceneKeyEventInit.key — the character or named key.

    modifiers: KeyModifiers

    Modifiers held at the instant of the event.

    repeat: boolean

    Whether the platform's auto-repeat produced this event — true for every keydown after the first while a key is held, and never for a keyup.

    A listener that must fire once per physical press (a button activation) ignores repeats; one that should accelerate while held (a traversal, a scroll) honours them.

    target: Node | null

    The node the event resolved to — the deepest hit for a pointer, the focused node for a key — and the node the propagation path ends at. null when the source resolved nothing; such an event has nowhere to propagate and is not dispatched.

    It stays the target for the whole walk: a listener on an ancestor reading event.target sees what was actually resolved, not the node it is listening on (which it already knows, having registered there).

    Which event this is.

    • get defaultPrevented(): boolean

      Whether SceneKeyEvent.preventDefault has been called.

      Returns boolean

    • get propagationStopped(): boolean

      Whether SceneInputEvent.stopPropagation has been called.

      Returns boolean

    • Tells the host not to do whatever it would normally do with this keystroke — the DOM's preventDefault, forwarded to the platform event when the source supplied one.

      Independent of SceneInputEvent.stopPropagation: this one is about the host, that one about the scene walk. A UI layer consuming Tab for §75 traversal wants this and usually not that (an ancestor may legitimately want to see the Tab it just handled).

      Idempotent, and safe on an event with no platform behind it.

      Returns void

    • Stops the event before the next node on the path — the DOM's stopPropagation, not stopImmediatePropagation.

      The remaining listeners on the node currently dispatching still run: §6b rule 2 makes registration order the contract within one emitter, and letting one listener cancel its siblings would make that order decide who gets to see an event. (There is deliberately no stopImmediatePropagation: no §72 requirement asks for one.)

      Called during the capture phase, it stops the descent as well, so the target never sees the event at all.

      Returns void