Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventHandler

... Provider and event handler are explicitly separated in order to reduce the number of observables (reuse of event provider for multiple handler).

Hierarchy

  • EventHandler

Index

Constructors

constructor

Properties

Protected _eyeGazeEventHandlerByType

_eyeGazeEventHandlerByType: Map<Type, EyeGazeEventHandler[]> = ...

Protected _eyeGazeEventProvider

_eyeGazeEventProvider: undefined | EyeGazeEventProvider

Assigned eye gaze event provider. This is usually created and owned by the eye gaze data stream.

Protected _invalidate

_invalidate: undefined | Invalidate

The event handler's invalidation callback. This should usually be setup by the owning renderer and invoke the same callback the renderer has been given by the canvas. This invalidation is required, when continuous rendering is not present, events might cause need for new rendering requests.

Protected _keyboardEventHandlerByType

_keyboardEventHandlerByType: Map<KeyboardEventType, KeyboardEventHandler[]> = ...

Protected _keyboardEventProvider

_keyboardEventProvider: undefined | KeyboardEventProvider

Assigned keyboard event provider. This is usually created and owned by the canvas.

Protected _latestEyeGazeEventsByType

_latestEyeGazeEventsByType: Map<Type, EyeGazeEvent[]> = ...

Protected _latestKeyboardEventsByType

_latestKeyboardEventsByType: Map<KeyboardEventType, KeyboardEvent[]> = ...

Protected _latestMouseEventsByType

_latestMouseEventsByType: Map<Type, MouseEvent[]> = ...

Protected _latestPointerEventsByType

_latestPointerEventsByType: Map<Type, PointerEvent[]> = ...

Protected _latestTouchEventsByType

_latestTouchEventsByType: Map<Type, TouchEvent[]> = ...

Protected _mouseEventHandlerByType

_mouseEventHandlerByType: Map<Type, MouseEventHandler[]> = ...

Protected _mouseEventProvider

_mouseEventProvider: undefined | MouseEventProvider

Assigned mouse event provider. This is usually created and owned by the canvas.

Protected _pointerEventHandlerByType

_pointerEventHandlerByType: Map<Type, PointerEventHandler[]> = ...

Protected _pointerEventProvider

_pointerEventProvider: undefined | PointerEventProvider

Assigned pointer event provider. This is usually created and owned by the canvas.

Protected _previousEyeGazeEventsByType

_previousEyeGazeEventsByType: Map<Type, EyeGazeEvent[]> = ...

Protected _previousKeyboardEventsByType

_previousKeyboardEventsByType: Map<KeyboardEventType, KeyboardEvent[]> = ...

Protected _previousMouseEventsByType

_previousMouseEventsByType: Map<Type, MouseEvent[]> = ...

Protected _previousPointerEventsByType

_previousPointerEventsByType: Map<Type, PointerEvent[]> = ...

Protected _previousTouchEventsByType

_previousTouchEventsByType: Map<Type, TouchEvent[]> = ...

Protected _subscriptions

_subscriptions: Subscription[] = ...

Protected _touchEventHandlerByType

_touchEventHandlerByType: Map<Type, TouchEventHandler[]> = ...

Protected _touchEventProvider

_touchEventProvider: undefined | TouchEventProvider

Assigned touch event provider. This is usually created and owned by the canvas.

Methods

dispose

  • dispose(): void

exitPointerLock

  • exitPointerLock(): void
  • Forward pointer lock release request to the mouse event provider (if one exists).

    Returns void

Protected invalidate

  • invalidate(force?: boolean): void

Protected invokeEyeGazeEventHandler

  • invokeEyeGazeEventHandler(type: Type): void

Protected invokeKeyboardEventHandler

  • invokeKeyboardEventHandler(type: KeyboardEventType): void

Protected invokeMouseEventHandler

  • invokeMouseEventHandler(type: Type): void

Protected invokePointerEventHandler

  • invokePointerEventHandler(type: Type): void

Protected invokeTouchEventHandler

  • invokeTouchEventHandler(type: Type): void

offsets

  • offsets(event: MouseEvent | WheelEvent | TouchEvent, normalize?: boolean): vec2[]
  • Normalize mouse and touch event coordinates for various browsers.

    Parameters

    • event: MouseEvent | WheelEvent | TouchEvent

      Mouse, wheel, or touch event.

    • normalize: boolean = true

      Whether or not to compute normalized coordinates (offsets).

    Returns vec2[]

    • Array of normalized x and y offsets (in case of multiple touches).

pushClickHandler

  • pushClickHandler(handler: MouseEventHandler): void
  • Register a click event handler that is to be called on update iff at least a single click event has occurred since last update.

    Parameters

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

pushEyeGazeBinaryMessageParsingErrorHandler

  • pushEyeGazeBinaryMessageParsingErrorHandler(handler: EyeGazeEventHandler): void
  • Register a eye gaze binary message parsing error event handler that is to be called on update if at least a single eye gaze binary message parsing error event has occurred since last update.

    Parameters

    • handler: EyeGazeEventHandler

      Handler to be called on update.

    Returns void

pushEyeGazeConnectionStatusHandler

  • pushEyeGazeConnectionStatusHandler(handler: EyeGazeEventHandler): void
  • Register a eye gaze connection status event handler that is to be called on update if at least a single eye gaze connection status event has occurred since last update.

    Parameters

    • handler: EyeGazeEventHandler

      Handler to be called on update.

    Returns void

pushEyeGazeDataHandler

  • pushEyeGazeDataHandler(handler: EyeGazeEventHandler): void
  • Register a eye gaze data event handler that is to be called on update if at least a single eye gaze data event has occurred since last update.

    Parameters

    • handler: EyeGazeEventHandler

      Handler to be called on update.

    Returns void

Protected pushEyeGazeEventHandler

  • pushEyeGazeEventHandler(type: Type, handler: EyeGazeEventHandler): void
  • Utility for registering an additional touch event handler for updates on touch events of the given type. The handler is to be called on update iff at least a single touch event of the given type has occurred since last update.

    Parameters

    • type: Type

      Touch event type the handler is to be associated with.

    • handler: EyeGazeEventHandler

      Handler to be called on update.

    Returns void

pushEyeGazeServerMessageHandler

  • pushEyeGazeServerMessageHandler(handler: EyeGazeEventHandler): void
  • Register a eye gaze server message event handler that is to be called on update if at least a single eye gaze server message event has occurred since last update.

    Parameters

    • handler: EyeGazeEventHandler

      Handler to be called on update.

    Returns void

pushKeyDownHandler

  • pushKeyDownHandler(handler: KeyboardEventHandler): void
  • Register a key down event handler that is to be called on update if at least a single key down event has occurred since last update.

    Parameters

    • handler: KeyboardEventHandler

      Handler to be called on update.

    Returns void

pushKeyPressHandler

  • pushKeyPressHandler(handler: KeyboardEventHandler): void
  • Register a key press event handler that is to be called on update if at least a single key press event has occurred since last update.

    Parameters

    • handler: KeyboardEventHandler

      Handler to be called on update.

    Returns void

pushKeyUpHandler

  • pushKeyUpHandler(handler: KeyboardEventHandler): void
  • Register a key up event handler that is to be called on update if at least a single key up event has occurred since last update.

    Parameters

    • handler: KeyboardEventHandler

      Handler to be called on update.

    Returns void

Protected pushKeyboardEventHandler

  • pushKeyboardEventHandler(type: KeyboardEventType, handler: KeyboardEventHandler): void
  • Utility for registering an additional keyboard event handler for updates on keyboard events of the given type. The handler is to be called on update if at least a single keyboard event of the given type has occurred since last update.

    Parameters

    • type: KeyboardEventType

      Keyboard event type the handler is to be associated with.

    • handler: KeyboardEventHandler

      Handler to be called on update.

    Returns void

pushMouseDownHandler

  • pushMouseDownHandler(handler: MouseEventHandler): void
  • Register an mouse down event handler that is to be called on update iff at least a single mouse down event has occurred since last update.

    Parameters

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

pushMouseEnterHandler

  • pushMouseEnterHandler(handler: MouseEventHandler): void
  • Register an mouse enter event handler that is to be called on update iff at least a single mouse enter event has occurred since last update.

    Parameters

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

Protected pushMouseEventHandler

  • pushMouseEventHandler(type: Type, handler: MouseEventHandler): void
  • Utility for registering an additional mouse event handler for updates on mouse events of the given type. The handler is to be called on update if at least a single mouse event of the given type has occurred since last update.

    Parameters

    • type: Type

      Mouse event type the handler is to be associated with.

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

pushMouseLeaveHandler

  • pushMouseLeaveHandler(handler: MouseEventHandler): void
  • Register an mouse leave event handler that is to be called on update iff at least a single mouse leave event has occurred since last update.

    Parameters

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

pushMouseMoveHandler

  • pushMouseMoveHandler(handler: MouseEventHandler): void
  • Register an mouse move event handler that is to be called on update iff at least a single mouse move event has occurred since last update.

    Parameters

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

pushMouseUpHandler

  • pushMouseUpHandler(handler: MouseEventHandler): void
  • Register an mouse up event handler that is to be called on update iff at least a single mouse up event has occurred since last update.

    Parameters

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

pushMouseWheelHandler

  • pushMouseWheelHandler(handler: MouseEventHandler): void
  • Register an mouse wheel event handler that is to be called on update iff at least a single mouse wheel event has occurred since last update.

    Parameters

    • handler: MouseEventHandler

      Handler to be called on update.

    Returns void

pushPointerCancelHandler

  • pushPointerCancelHandler(handler: PointerEventHandler): void
  • Register a pointer cancel event handler that is to be called on update iff at least a single touch cancel event has occurred since last update.

    Parameters

    • handler: PointerEventHandler

      Handler to be called on update.

    Returns void

pushPointerDownHandler

  • pushPointerDownHandler(handler: PointerEventHandler): void
  • Register a pointer down event handler that is to be called on update iff at least a single touch cancel event has occurred since last update.

    Parameters

    • handler: PointerEventHandler

      Handler to be called on update.

    Returns void

pushPointerEnterHandler

  • pushPointerEnterHandler(handler: PointerEventHandler): void
  • Register a pointer enter event handler that is to be called on update iff at least a single touch cancel event has occurred since last update.

    Parameters

    • handler: PointerEventHandler

      Handler to be called on update.

    Returns void

Protected pushPointerEventHandler

  • pushPointerEventHandler(type: Type, handler: PointerEventHandler): void
  • Utility for registering an additional pointer event handler for updates on pointer events of the given type. The handler is to be called on update iff at least a single touch event of the given type has occurred since last update.

    Parameters

    • type: Type

      Pointer event type the handler is to be associated with.

    • handler: PointerEventHandler

      Handler to be called on update.

    Returns void

pushPointerLeaveHandler

  • pushPointerLeaveHandler(handler: PointerEventHandler): void
  • Register a pointer leave event handler that is to be called on update iff at least a single touch cancel event has occurred since last update.

    Parameters

    • handler: PointerEventHandler

      Handler to be called on update.

    Returns void

pushPointerMoveHandler

  • pushPointerMoveHandler(handler: PointerEventHandler): void
  • Register a pointer move event handler that is to be called on update iff at least a single touch cancel event has occurred since last update.

    Parameters

    • handler: PointerEventHandler

      Handler to be called on update.

    Returns void

pushPointerUpHandler

  • pushPointerUpHandler(handler: PointerEventHandler): void
  • Register a pointer up event handler that is to be called on update iff at least a single touch cancel event has occurred since last update.

    Parameters

    • handler: PointerEventHandler

      Handler to be called on update.

    Returns void

pushTouchCancelHandler

  • pushTouchCancelHandler(handler: TouchEventHandler): void
  • Register a touch cancel event handler that is to be called on update iff at least a single touch cancel event has occurred since last update.

    Parameters

    • handler: TouchEventHandler

      Handler to be called on update.

    Returns void

pushTouchEndHandler

  • pushTouchEndHandler(handler: TouchEventHandler): void
  • Register a touch end event handler that is to be called on update iff at least a single touch end event has occurred since last update.

    Parameters

    • handler: TouchEventHandler

      Handler to be called on update.

    Returns void

Protected pushTouchEventHandler

  • pushTouchEventHandler(type: Type, handler: TouchEventHandler): void
  • Utility for registering an additional touch event handler for updates on touch events of the given type. The handler is to be called on update iff at least a single touch event of the given type has occurred since last update.

    Parameters

    • type: Type

      Touch event type the handler is to be associated with.

    • handler: TouchEventHandler

      Handler to be called on update.

    Returns void

pushTouchMoveHandler

  • pushTouchMoveHandler(handler: TouchEventHandler): void
  • Register a touch move event handler that is to be called on update iff at least a single touch move event has occurred since last update.

    Parameters

    • handler: TouchEventHandler

      Handler to be called on update.

    Returns void

pushTouchStartHandler

  • pushTouchStartHandler(handler: TouchEventHandler): void
  • Register a touch start event handler that is to be called on update iff at least a single touch start event has occurred since last update.

    Parameters

    • handler: TouchEventHandler

      Handler to be called on update.

    Returns void

requestPointerLock

  • requestPointerLock(): void

update

  • update(): void
  • Triggers (by means of a helper function) invocation of all registered handler of all event types.

    Returns void