nx.js
Enumerations

Button

Mapping of the button indicies on a Gamepad to the corresponding name of the button on the controller.

Example

import { Button } from '@nx.js/constants';
 
const pad = navigator.getGamepads()[0];
if (pad.buttons[Button.A].pressed) {
  console.log('Button A is pressed');
}

Enumeration Members

Enumeration MemberValue
A1
B0
Down13
L4
Left14
Minus8
Plus9
R5
Right15
StickL10
StickR11
Up12
X3
Y2
ZL6
ZR7

On this page