nativeDeviceInputSystem.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. import type { IUIEvent } from "../Events/deviceInputEvents";
  2. import { DeviceType } from "./InputDevices/deviceEnums";
  3. import type { IDeviceInputSystem } from "./inputInterfaces";
  4. /** @internal */
  5. export declare class NativeDeviceInputSystem implements IDeviceInputSystem {
  6. private readonly _nativeInput;
  7. constructor(onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void, onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void, onInputChanged: (deviceType: DeviceType, deviceSlot: number, eventData: IUIEvent) => void);
  8. /**
  9. * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
  10. * @param deviceType Enum specifying device type
  11. * @param deviceSlot "Slot" or index that device is referenced in
  12. * @param inputIndex Id of input to be checked
  13. * @returns Current value of input
  14. */
  15. pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
  16. /**
  17. * Check for a specific device in the DeviceInputSystem
  18. * @param deviceType Type of device to check for
  19. * @returns bool with status of device's existence
  20. */
  21. isDeviceAvailable(deviceType: DeviceType): boolean;
  22. /**
  23. * Dispose of all the observables
  24. */
  25. dispose(): void;
  26. /**
  27. * For versions of BabylonNative that don't have the NativeInput plugin initialized, create a dummy version
  28. * @returns Object with dummy functions
  29. */
  30. private _createDummyNativeInput;
  31. }