Skip to content

watch()

Samir Zahran edited this page Aug 30, 2016 · 1 revision

Begin listening for input events.

The .watch() method signals to a gamepad that it should begin reporting button and analog stick events to the DOM. .watch() is called automatically when a gamepad is connected.

Examples

var controller = Controller.getController(0);
controller.watch();

// button and analog stick events will begin firing for this controller
Clone this wiki locally