Skip to content

BrowserEvents

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/scenery/blob/main/js/input/BrowserEvents.ts for the most up-to-date information.

Overview

Handles attaching/detaching and forwarding browser input events to displays.

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

Class BrowserEvents

import { BrowserEvents } from 'scenerystack/scenery';

Static Methods

addDisplay( display : Display, attachToWindow : boolean, passiveEvents : boolean | null )

Adds a Display to the list of displays that will be notified of input events.

@param display @param attachToWindow - Whether events should be attached to the self. If false, they will be attached to the Display's domElement. @param passiveEvents - The value of the passive option for adding/removing DOM event listeners

removeDisplay( display : Display, attachToWindow : boolean, passiveEvents : boolean | null )

Removes a Display to the list of displays that will be notified of input events.

@param display @param attachToWindow - The value provided to addDisplay @param passiveEvents - The value of the passive option for adding/removing DOM event listeners

onfocusin( domEvent : Event )

onfocusout( domEvent : Event )

oninput( domEvent : Event )

onchange( domEvent : Event )

onclick( domEvent : Event )

onkeydown( domEvent : Event )

onkeyup( domEvent : Event )

Static Properties

blockFocusCallbacks

Prevents focus related event callbacks from being dispatched - scenery internal operations might change focus temporarily, we don't want event listeners to be called in this case because they are transient and not caused by user interaction.

dispatchingFocusEvents

True while Scenery is dispatching focus and blur related events. Scenery (PDOMTree) needs to restore focus after operations, but that can be very buggy while focus events are already being handled.

Source Code

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