for (const source of frame.session.inputSources) {
const gamepad = source.gamepad;
if (gamepad) {
if (gamepad.buttons[2].pressed) {
// do something
}
}
}XRInputSource: gamepad property / notebook
XRInputSource: gamepad property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.