Let's talk about Javascript...

Benjamin Lannon

February 14, 2018

First up: Safety First

This isn't a talk about Nintendo

It's about Javascript

Specifically: the Gamepad API

What if I told you that you could use any gamepad ever to control webpages or web games in JS?

Attaching Gamepads


	window.addEventListener( 'gamepadconnected', function(e) {
	  console.log( e.gamepad.id );
	} );
					

Following you can get movement for joysticks axes and button presses.

use requestAnimationFrame() to get updates from any gamepad

Use case: Web Presentations

Github Link: https://github.com/bibixx/reveal.js-gamepad-plugin

Web Browser Support

Questions?