Interface MotionEvent

A device motion event payload.

Modeled after https://developer.mozilla.org/de/docs/Web/API/DeviceMotionEvent.

Hierarchy

  • BaseInputEvent<"motion">
    • MotionEvent

Properties

acceleration: {
    x: number;
    y: number;
    z: number;
}

The acceleration of the device in m/s^2 (in 3D space).

Type declaration

  • x: number

    The acceleration on the x-axis.

  • y: number

    The acceleration on the y-axis.

  • z: number

    The acceleration on the z-axis.

accelerationIncludingGravity: {
    x: number;
    y: number;
    z: number;
}

The acceleration of the device, including gravity, in m/s^2 (in 3D space).

Type declaration

  • x: number

    The acceleration on the x-axis (west to east).

  • y: number

    The acceleration on the y-axis (south to north).

  • z: number

    The acceleration on the z-axis (down to up).

interval: number

The granularity of these events in ms.

rotationRate: {
    alpha: number;
    beta: number;
    gamma: number;
}

The rotation rate in deg/s on the three rotation axes alpha, beta and gamma.

Type declaration

  • alpha: number

    The rate at which the device rotates about its z-axis (i.e. is twisted around a line perpendicular to its screen.)

  • beta: number

    The rate at which the device rotates about its x-axis (i.e. front to back)

  • gamma: number

    The rate at which the device rotates about its y-axis (i.e. side to side)

source: string | number

The identifier, unique per client + device combo.

type: "motion"

The event type.

Generated using TypeDoc