deviceInputSystem.ts 843 B

123456789101112131415161718192021222324
  1. /**
  2. * IDeviceInputSystem
  3. * Interface for input systems
  4. */
  5. export interface IDeviceInputSystem
  6. {
  7. /**
  8. * pollInput - Get value from input
  9. * @param deviceName - name of device
  10. * @param inputIndex - index of specific input
  11. * @returns value of input
  12. */
  13. pollInput(deviceName : string, inputIndex : number) : number;
  14. /**
  15. * onDeviceConnected - Set callback for when a device is connected
  16. * @param callback - function to perform when a device is connected
  17. */
  18. onDeviceConnected(callback : (deviceName : string) => void) : void;
  19. /**
  20. * onDeviceDisconnected - Set callback for when a device is disconnected
  21. * @param callback - function to perform when a device is disconnected
  22. */
  23. onDeviceDisconnected(callback : (deviceName : string) => void) : void;
  24. }