UNPKG

@mesmotronic/xpad

Version:

Simplified Gamepad API for Xbox 360 and Xbox One controllers

32 lines (31 loc) 906 B
import { EventDispatcher } from "conbine"; import { XpadStick } from "./XpadStick"; import { XpadEvent } from "../events/XpadEvent"; export declare class XpadState extends EventDispatcher { #private; leftStick: XpadStick; rightStick: XpadStick; dpad: XpadStick; /** * Enable or disable D-pad input as part of the anyStick calculation */ dpadEnabled: boolean; constructor(); get buttons(): number[]; set buttons(value: number[]); get sticks(): XpadStick[]; /** * Get the current state of the left stick, right stick or D-pad */ get anyStick(): XpadStick; /** * @deprecated Use anyStick instead */ get anyAxes(): XpadStick; /** * Check if any button is pressed (excludes D-pad and stick buttons) */ get anyButton(): number; reset(): void; protected redispatchEvent: (event: XpadEvent) => void; }