DeviceMotionEvent

open class DeviceMotionEvent(val type: EventType<DeviceMotionEvent>, init: DeviceMotionEventInit = definedExternally) : Event(source)

The DeviceMotionEvent interface of the Device Orientation Events provides web developers with information about the speed of changes for the device's position and orientation. Available only in secure contexts.

MDN Reference

Constructors

Link copied to clipboard
constructor(type: EventType<DeviceMotionEvent>, init: DeviceMotionEventInit = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The acceleration read-only property of the DeviceMotionEvent interface returns the acceleration recorded by the device, in meters per second squared (m/s²). This value does not include the effect of the gravitational force, in contrast to DeviceMotionEvent.accelerationIncludingGravity.

Link copied to clipboard

The accelerationIncludingGravity read-only property of the DeviceMotionEvent interface returns the amount of acceleration recorded by the device, in meters per second squared (m/s²). Unlike DeviceMotionEvent.acceleration which compensates for the influence of gravity, its value is the sum of the acceleration of the device as induced by the user and an acceleration equal and opposite to that caused by gravity. In other words, it measures the g-force. In practice, this value represents the raw data measured by an accelerometer.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The interval read-only property of the DeviceMotionEvent interface returns the interval, in milliseconds, at which data is obtained from the underlying hardware. You can use this to determine the granularity of motion events.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The rotationRate read-only property of the DeviceMotionEvent interface returns the rate at which the device is rotating around each of its axes in degrees per second.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val type: EventType<DeviceMotionEvent>

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard