A device motion handler that dispatches a "shake" event as appropriate.

Original author: Jesse Jackson - https://github.com/jsejcksn This part of the code is licensed under CC BY-SA 4.0

Hierarchy

Constructors

Methods

  • Add a new shake event listener.

    Parameters

    • type: "shake"

      The type of the event to handle.

    • listener: null | ShakeEventListener

      The event handler to call.

    • Optionaloptions: boolean | AddEventListenerOptions

      The options for this handler.

    Returns void

  • Dispatch a shake event.

    Parameters

    Returns boolean

    true if the event was cancelled, false otherwise.

  • Removes a previously added event listener.

    Parameters

    • type: "shake"

      The type of the event to remove.

    • callback: null | ShakeEventListener

      The event handler to remove.

    • Optionaloptions: boolean | EventListenerOptions

      The options the event handler was added with.

    Returns void