@mesmotronic/xpad
Version:
Simplified Gamepad API for Xbox 360 and Xbox One controllers
33 lines (32 loc) • 915 B
TypeScript
import { EventDispatcher } from "conbine";
import { XpadEvent } from "../events/XpadEvent";
import { XpadState } from "../models/XpadState";
export declare class Xpad extends EventDispatcher {
#private;
readonly index: number;
inputThreshold: number;
constructor(index?: number);
/**
* Returns true if the Xpad is connected
*/
get connected(): boolean;
/**
* Returns the Gamepad instance for this Xpad
*/
get gamepad(): Gamepad | null;
/**
* Returns the current state of the Xpad
*/
get state(): XpadState;
/**
* Updates the state of the Xpad
*/
update: () => void;
/**
* Resets the state of the Xpad
*/
reset(): void;
protected redispatchEvent: (event: XpadEvent) => void;
protected connectedHandler: (event: GamepadEvent) => void;
protected disconnectedHandler: (event: GamepadEvent) => void;
}