slimdx-gamepad

0.0.1 • Public • Published

SlimDX Gamepad

Provides a simple interface for accessing the Xbox controller through SlimDX

Usage

var Gamepad = require('slimdx-gamepad');
var gamepad1 = new Gamepad(1);

Constructor

  • new Gamepad( playerID )
    • int playerID: Which controller to listen to. 0 will use any controller available.

Properties

{
	A: bool,
	B: bool,
	X: bool,
	Y: bool,
	Start: bool,
	Back: bool,
	DPad: {
	    Up: bool,
	    Down: bool,
	    Left: bool,
	    Right: bool
	},
	LeftBumper: bool,
	RightBumper: bool,
	LeftTrigger: float,
	RightTrigger: float,
	Thumbsticks: {
	    Left: {
	        Click: bool,
	        X: float,
	        Y: float
	    },
	    Right: {
	        Click: bool,
	        X: float,
	        Y: float
	    }
	}
}

Methods

  • loadState()
    • Loads the current state of the gamepad
  • destroy()
    • Destroys gamepad reference

Package Sidebar

Install

npm i slimdx-gamepad

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • mcluck