let gp = navigator.getGamepads()[0]; // Get the first gamepad object
if (gp.buttons[0].touched) {
// respond to button being touched
}GamepadButton: touched property / notebook
GamepadButton: touched property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.