@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
53 lines (52 loc) • 1.57 kB
TypeScript
import { Observable } from "../Misc/observable.js";
import type { Nullable } from "../types.js";
import type { Scene } from "../scene.js";
import { Gamepad } from "./gamepad.js";
/**
* Manager for handling gamepads
*/
export declare class GamepadManager {
private _scene?;
private _babylonGamepads;
private _oneGamepadConnected;
/** @internal */
_isMonitoring: boolean;
private _gamepadEventSupported;
private _gamepadSupport?;
/**
* observable to be triggered when the gamepad controller has been connected
*/
onGamepadConnectedObservable: Observable<Gamepad>;
/**
* observable to be triggered when the gamepad controller has been disconnected
*/
onGamepadDisconnectedObservable: Observable<Gamepad>;
private _onGamepadConnectedEvent;
private _onGamepadDisconnectedEvent;
/**
* Initializes the gamepad manager
* @param _scene BabylonJS scene
*/
constructor(_scene?: Scene | undefined);
/**
* The gamepads in the game pad manager
*/
get gamepads(): Gamepad[];
/**
* Get the gamepad controllers based on type
* @param type The type of gamepad controller
* @returns Nullable gamepad
*/
getGamepadByType(type?: number): Nullable<Gamepad>;
/**
* Disposes the gamepad manager
*/
dispose(): void;
private _addNewGamepad;
private _startMonitoringGamepads;
private _stopMonitoringGamepads;
private _loggedErrors;
/** @internal */
_checkGamepadsStatus(): void;
private _updateGamepadObjects;
}