Skip to content

EventContext

Overview

A collection of information about an event and the environment when it was fired

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class EventContext

import { EventContext } from 'scenerystack/scenery';

Constructor

new EventContext( domEvent : DOMEvent )

Instance Methods

allowsDOMInput() : boolean

DOM (Scenery) nodes set dataset.sceneryAllowInput on their container if they don't want preventDefault to be called, or other effects that block input (e.g. setPointerCapture). We search up the tree to detect this.

Instance Properties

domEvent : DOMEvent

(readonly)

Raw DOM InputEvent (TouchEvent, PointerEvent, MouseEvent,...)

activeElement : Element | null

(readonly)

The document.activeElement when the event was fired

Static Methods

createSynthetic() : EventContext

Source Code

See the source for EventContext.ts in the scenery repository.