@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.
32 lines (31 loc) • 1.54 kB
TypeScript
import type { IUIEvent } from "../Events/deviceInputEvents.js";
import { DeviceType } from "./InputDevices/deviceEnums.js";
import type { IDeviceInputSystem } from "./inputInterfaces.js";
/** @internal */
export declare class NativeDeviceInputSystem implements IDeviceInputSystem {
private readonly _nativeInput;
constructor(onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void, onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void, onInputChanged: (deviceType: DeviceType, deviceSlot: number, eventData: IUIEvent) => void);
/**
* Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
* @param deviceType Enum specifying device type
* @param deviceSlot "Slot" or index that device is referenced in
* @param inputIndex Id of input to be checked
* @returns Current value of input
*/
pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
/**
* Check for a specific device in the DeviceInputSystem
* @param deviceType Type of device to check for
* @returns bool with status of device's existence
*/
isDeviceAvailable(deviceType: DeviceType): boolean;
/**
* Dispose of all the observables
*/
dispose(): void;
/**
* For versions of BabylonNative that don't have the NativeInput plugin initialized, create a dummy version
* @returns Object with dummy functions
*/
private _createDummyNativeInput;
}