Table of Contents

Class DeviceOrientationEvent

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The DeviceOrientationEvent interface of the {{domxref("Device Orientation Events", "", "", "nocode")}} provides web developers with information from the physical orientation of the device running the web page.

[Value("DeviceOrientationEvent")]
public class DeviceOrientationEvent : Event
Inheritance
DeviceOrientationEvent
Inherited Members

Remarks

-{{domxref("Device orientation events/Detecting device orientation", "Detecting device orientation", "", "nocode")}}
-{{domxref("Device orientation events/Orientation and motion data explained", "Orientation and motion data explained", "", "nocode")}}
-DeviceMotionEvent
-Window.Devicemotion event
-Window.Deviceorientation event
-Window.Deviceorientationabsolute event

See also on MDN

Constructors

DeviceOrientationEvent()

public DeviceOrientationEvent()

DeviceOrientationEvent(string, DeviceOrientationEventInit)

The DeviceOrientationEvent() constructor creates a new DeviceOrientationEvent object.

public DeviceOrientationEvent(string type, DeviceOrientationEventInit eventInitDict = null)

Parameters

type string
eventInitDict DeviceOrientationEventInit

Remarks

Properties

Absolute

The absolute read-only property of the DeviceOrientationEvent interface indicates whether or not the device is providing orientation data absolutely (that is,
in reference to the Earth's coordinate frame) or using some arbitrary frame determined
by the device.
See Orientation and motion data explained for details.

[Value("absolute")]
public bool Absolute { get; }

Property Value

bool

Remarks

-{{domxref("Device orientation events/Detecting device orientation", "Detecting device orientation", "", "nocode")}}
-{{domxref("Device orientation events/Orientation and motion data explained", "Orientation and motion data explained", "", "nocode")}}
-Window.Deviceorientation event
-Window.Deviceorientationabsolute event

See also on MDN

Alpha

The alpha read-only property of the DeviceOrientationEvent interface returns the rotation of the device around the Z axis; that is, the number of degrees by
which the device is being twisted around the center of the screen.
See Orientation and motion data explained for details.

[Value("alpha")]
public Number? Alpha { get; }

Property Value

Number

A number.

Remarks

-{{domxref("Device orientation events/Detecting device orientation", "Detecting device orientation", "", "nocode")}}
-{{domxref("Device orientation events/Orientation and motion data explained", "Orientation and motion data explained", "", "nocode")}}
-Window.Deviceorientation event
-Window.Deviceorientationabsolute event

See also on MDN

Beta

The beta read-only property of the DeviceOrientationEvent interface returns the rotation of the device around the X axis; that is, the number of degrees,
ranged between -180 and 180, by which the device is tipped forward or backward.
See Orientation and motion data explained for details.

[Value("beta")]
public Number? Beta { get; }

Property Value

Number

A number.

Remarks

-{{domxref("Device orientation events/Detecting device orientation", "Detecting device orientation", "", "nocode")}}
-{{domxref("Device orientation events/Orientation and motion data explained", "Orientation and motion data explained", "", "nocode")}}
-Window.Deviceorientation event
-Window.Deviceorientationabsolute event

See also on MDN

Gamma

The gamma read-only property of the DeviceOrientationEvent interface returns the rotation of the device around the Y axis; that is, the number of degrees,
ranged between -90 and 90, by which the device is tilted left
or right.
See Orientation and motion data explained for details.

[Value("gamma")]
public Number? Gamma { get; }

Property Value

Number

A number.

Remarks

-{{domxref("Device orientation events/Detecting device orientation", "Detecting device orientation", "", "nocode")}}
-{{domxref("Device orientation events/Orientation and motion data explained", "Orientation and motion data explained", "", "nocode")}}
-Window.Deviceorientation event
-Window.Deviceorientationabsolute event

See also on MDN

Methods

RequestPermission(bool)

[Value("requestPermission")]
public static Task<PermissionState> RequestPermission(bool absolute = false)

Parameters

absolute bool

Returns

Task<PermissionState>