let sources = xrSession.inputSources;
for (const [index, input] of sources.entries()) {
if (input.gamepad) {
checkGamepad(input.gamepad);
} else if (
input.targetRayMode === "tracked-pointer" &&
input.handedness === player.handedness
) {
/* Handle main hand controller */
handleMainHandInput(input);
} else {
/* Handle other inputs */
}
}XRInputSourceArray: entries() method / notebook
XRInputSourceArray: entries() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.