-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathtest.js
33 lines (26 loc) · 781 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var Gamepad = require("./.");
console.log("Gamepad", Gamepad);
// Create raw dispatcher to see all events.
Gamepad.context.on = console.log;
// Gamepad.on("down", function () {
// console.log("DOWN", arguments);
// });
// Gamepad.on("up", function () {
// console.log("UP", arguments);
// });
// Gamepad.on("move", function () {
// console.log("MOVE", arguments);
// });
// Gamepad.on("attach", function () {
// console.log("ATTACH", arguments);
// });
// Gamepad.on("remove", function () {
// console.log("REMOVE", arguments);
// });
console.log("init");
Gamepad.init()
var num = Gamepad.numDevices();
console.log("numDevices", num);
setInterval(Gamepad.processEvents, 16);
setInterval(Gamepad.detectDevices, 500);
// console.log("shutdown", Gamepad.shutdown());