The following snippet of code creates a new XRInputSourcesChangeEvent
object indicating that a single new input source, described by an
XRInputSource
object named newInputSource
, has been added to
the system.
let iscEvent = new XRInputSourcesChangeEvent("inputsourceschange", {
session: xrSession,
added: [newInputSource],
removed: [],
});
Specification |
---|
Product helpConstructorsession
InheritanceXRAnchor \nExperimental\nXRFrame \nExperimental\nXRPose XRRigidTransform XRSystem \nExperimental\nXRWebGLBinding \nExperimental\nXRWebGLLayer \nExperimental\n
","source":{"folder":"en-us/web/api/xrinputsourceschangeevent/xrinputsourceschangeevent","github_url":"https://github.com/mdn/content/blob/main/files/en-us/web/api/xrinputsourceschangeevent/index.md","last_commit_url":"https://github.com/mdn/content/commit/89c435da452257b944b403cc9e45036fcb22590e","filename":"index.md"},"summary":"The XRInputSourcesChangeEvent()\nconstructor creates and returns a new XRInputSourcesChangeEvent object,\nrepresenting an update to the list of available WebXR input devices. You\nwon't typically call this constructor yourself, as these events are created and sent to\nyou by the WebXR system.","title":"XRInputSourcesChangeEvent: XRInputSourcesChangeEvent() constructor","toc":[{"text":"Syntax","id":"syntax"},{"text":"Examples","id":"examples"},{"text":"Specifications","id":"specifications"},{"text":"Browser compatibility","id":"browser_compatibility"}],"baseline":{"baseline":false,"support":{"chrome":"79","chrome_android":"79","edge":"79"}},"browserCompat":["api.XRInputSourcesChangeEvent.XRInputSourcesChangeEvent"],"pageType":"web-api-constructor"}} |