function Gamepad()
{
	/**
	 * Vendor code of the gamepad device.
	 *
	 * @attribute vendor
	 * @type {number}
	 */
	this.vendor = -1;

	/**
	 * Product code of the gamepad device.
	 *
	 * @attribute product
	 * @type {number}
	 */
	this.product = -1;

	/**
	 * Connected state of the gamepad.
	 *
	 * @attribute connected
	 * @type {boolean}
	 */
	this.connected = false;
	
	this.gamepad = null;

	/**
	 * Gamepad buttons with their associated state.
	 *
	 * Should be different for every gamepad.
	 *
	 * @attribute buttons
	 * @type {Array}
	 */
	this.buttons = [];

	var gamepads = navigator.getGamepads();
	for (var i = 0; i < gamepads.length; i++)
	{
		if (gamepads[i] !== null)
		{
			this.setGamepad(gamepads[i]);
			break;
		}
	}
	
	if (this.gamepad === null)
	{
		console.warn("nunuStudio: No gamepad found");
	}
}
Gamepad provides basic support for gamepads.

Some gamepads require a button press to being detected.

Gamepad implementation across browsers is still fragmented, every browser implements it a bit differently, so test it on every target before deploying an application using it.

For more information about the Gamepad API state take look at the W3C Gamepad API page https:// www.w3.org/TR/gamepad/.

@class Gamepad
@module Input