Provides a simple interface for accessing the Xbox controller through SlimDX
var Gamepad = require('slimdx-gamepad');
var gamepad1 = new Gamepad(1);
- new Gamepad( playerID )
- int playerID: Which controller to listen to. 0 will use any controller available.
{
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
}
}
}
-
loadState()
- Loads the current state of the gamepad
-
destroy()
- Destroys gamepad reference