Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TouchEventProvider

Hierarchy

  • TouchEventProvider

Index

Constructors

constructor

  • new TouchEventProvider(element: HTMLCanvasElement, timeframe?: undefined | number): TouchEventProvider

Properties

Protected _cancelListener

_cancelListener: function

Type declaration

    • (event: TouchEvent): void
    • Parameters

      • event: TouchEvent

      Returns void

Protected _cancelSubject

_cancelSubject: ReplaySubject<TouchEvent>

Protected _element

_element: HTMLCanvasElement

HTML canvas element within the HTML5 document to register event listeners to.

Protected _endListener

_endListener: function

Type declaration

    • (event: TouchEvent): void
    • Parameters

      • event: TouchEvent

      Returns void

Protected _endSubject

_endSubject: ReplaySubject<TouchEvent>

Protected _moveListener

_moveListener: function

Type declaration

    • (event: TouchEvent): void
    • Parameters

      • event: TouchEvent

      Returns void

Protected _moveSubject

_moveSubject: ReplaySubject<TouchEvent>

Protected _preventDefaultMask

_preventDefaultMask: Type

This mask saves for which types of events, event.preventDefault should be called. This is useful to disallow some kinds of standard events like scrolling or clicking on links.

Protected _startListener

_startListener: function

Type declaration

    • (event: TouchEvent): void
    • Parameters

      • event: TouchEvent

      Returns void

Protected _startSubject

_startSubject: ReplaySubject<TouchEvent>

Protected _timeframe

_timeframe: number | undefined

Time frame for events to be buffered (windowTime in rxjs per ReplaySubject).

Accessors

cancel$

  • get cancel$(): Observable<TouchEvent>

end$

  • get end$(): Observable<TouchEvent>

move$

  • get move$(): Observable<TouchEvent>

start$

  • get start$(): Observable<TouchEvent>

Methods

allowDefault

  • allowDefault(...types: Type[]): void
  • Allow default event handling on specific event type (not calling preventDefault on the event).

    Parameters

    • Rest ...types: Type[]

      Event types to allow default handling on.

    Returns void

observable

  • observable(type: Type): Observable<TouchEvent>

preventDefault

  • preventDefault(...types: Type[]): void
  • Prevent default event handling on specific event type (using prevenDefault on the event).

    Parameters

    • Rest ...types: Type[]

      Event types to prevent default handling on.

    Returns void

Protected preventDefaultOnEvent

  • preventDefaultOnEvent(type: Type, event: TouchEvent): void
  • Checks whether or not to prevent the default handling of the given event. This depends on the internal preventDefaultMask which can be modified using preventDefault function @see{@link prevenDefault}.

    Parameters

    • type: Type

      Internal event type of the incoming event.

    • event: TouchEvent

      Actual event to prevent default handling on (if masked).

    Returns void