function watchAccelerometer() {
	if (hasAccelerometer && !accelInitialized) {
		if (
			DeviceOrientationEvent &&
			typeof DeviceOrientationEvent.requestPermission === "function"
		) {
			DeviceOrientationEvent.requestPermission()
				.then((response) => {
					if (response === "granted") {
						// add a listener for the devicemotion event
						globalThis.addEventListener("devicemotion", onDeviceMotion, false);
						accelInitialized = true;
					}
				})
				.catch(console.error);
		} else {
			// add a listener for the devicemotion event
			globalThis.addEventListener("devicemotion", onDeviceMotion, false);
			accelInitialized = true;
		}
	}
	return accelInitialized;
}
Enable monitor of the device accelerator to detect the amount of physical force of acceleration the device is receiving.
(one some device a first user gesture will be required before calling this function)
@memberof device
@see device.accelerationX
@see device.accelerationY
@see device.accelerationZ
@link {http://www.mobilexweb.com/samples/ball.html}
@link {http://www.mobilexweb.com/blog/safari-ios-accelerometer-websockets-html5}
@returns {boolean} false if not supported or permission not granted by the user
@example
// try to enable device accelerometer event on user gesture
me.input.registerPointerEvent("pointerleave", me.game.viewport, function() {
    if (me.device.watchAccelerometer() === true) {
        // Success
        me.input.releasePointerEvent("pointerleave", me.game.viewport);
    } else {
        // ... fail at enabling the device accelerometer event
    }
});