安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
XRInputSourceEventInit
dictionary's
inputSource
property is used when calling the
XRInputSourceEvent()
constructor to specify the
XRInputSource
from which the newly-created event is being sent.
Of course, as a general rule, you won't need to create
XRInputSourceEventInit
objects yourself. These events are generated by and sent to you by the WebXR infrastructure.
let xrInputSourceEventInit.inputSource = xrInputSource;
let xrInputSourceEventInit = { inputSource: xrInputSource };
let xrInputSourceEvent = new XRInputSourceEvent(type, { inputSource: xrInputSource });
XRInputSource
object indicating the source of the newly-created
XRInputSourceEvent
to be created. The new object's
inputSource
will be set to this value.
This example creates a new
select
event and sends it to the
XRSession
.
let event = new XRInputSourceEvent("select", {
frame: eventFrame,
inputSource: source
};
if (event) {
xrSession.dispatchEvent(event);
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebXR 设备 API
The definition of 'XRInputSourceEventInit.inputSource' in that specification. |
工作草案 | 初始定义。 |
XRInputSourceEventInit
inputSource
Navigator.xr
WebGLRenderingContext.makeXRCompatible()
XR
XRBoundedReferenceSpace
XRFrame
XRInputSource
XRInputSourceArray
XRInputSourceEvent
XRInputSourcesChangeEvent
XRPose
XRReferenceSpace
XRReferenceSpaceEvent
XRRenderState
XRRigidTransform
XRSession
XRSessionEvent
XRSpace
XRView
XRViewerPose
XRViewport
XRWebGLLayer