安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
只读
inputSources
特性为
XRSession
interface returns an
XRInputSourceArray
object which lists all controllers and input devices which are expressly associated with the XR device and are currently available.
These controllers may include handheld controllers, XR-equipped gloves, optically tracked hands, and gaze-based input methods. Keyboards, gamepads, and mice are
not
considered WebXR input sources.
注意: Traditional gamepad controllers are supported using the 手柄 API .
inputSources = xrSession.inputSources;
XRInputSourceArray
object listing all of the currently-connected input controllers which are linked specifically to the XR device currently in use. The returned object is
live
; as devices are connected to and removed from the user's system, the list's contents update to reflect the changes.
You can add a handler for the
XRSession
event
inputsourceschange
to be advised when the contents of the session's connected devices list changes. You can then either get the value of
inputSources
to examine the list, or you can refer to a reference to the list that you've previously saved.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebXR 设备 API
The definition of 'XRSession.inputSources' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
inputSources
|
Chrome 79 | Edge 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 79 | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 11.2 |
完整支持
不支持
XRSession
environmentBlendMode
inputSources
renderState
visibilityState
Navigator.xr
WebGLRenderingContext.makeXRCompatible()
XR
XRBoundedReferenceSpace
XRFrame
XRInputSource
XRInputSourceArray
XRInputSourceEvent
XRInputSourcesChangeEvent
XRPose
XRReferenceSpace
XRReferenceSpaceEvent
XRRenderState
XRRigidTransform
XRSessionEvent
XRSpace
XRView
XRViewerPose
XRViewport
XRWebGLLayer