Touch script interface

The ITouchObjectType interface derives from IObjectClass to add APIs specific to the Touch plugin.

Note this class derives from the object class interface, not the instance interface. Typically it is used through runtime.touch instead of the named object.

Touch APIs

async requestPermission(type)
Request permission to use device orientation or motion sensors. The "deviceorientation" and "devicemotion" events will not fire unless this method has been called and permission granted. type must be "orientation" or "motion". The user may be prompted to allow permission. Note some browsers merge both types in to one permission prompt in which case only one permission request is necessary to access both orientation and motion. Returns a promise that resolves with "granted" if permission was allowed, else "denied" if the user declined.
Construct 3 Manual 2019-08-14

On this page