1.2.4 • Published 6 years ago

gamepad-info v1.2.4

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

gamepad-info

Retrieve information about a gamepad

build status npm

Installation

$ npm install gamepad-info

Example

const getGamepadInfo = require('gamepad-info')

const gamepad = navigator.getGamepads()[0]
const gamepadName = getGamepadInfo(gamepad).name
console.log(`Your gamepad is called "${gamepadName}".`)

API

getGamepadInfo(input)

Takes in a Gamepad instance or a gamepad.id string and returns an object like this:

{ name: 'Xbox 360 Wireless Receiver',
  vendorId: '045e',
  vendor: 'microsoft',
  productId: '0719' }
  • name is the user-friendly name of the gamepad.
  • vendorId is the vendor's USB vendor ID.
  • vendor is the vendor's name and only available for some vendors.
  • productId is the ID of the product and might vary between browsers.

License

MIT © Niklas Higi

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago