Browse Source

PR Feedback part 3

Dave Solares 5 years ago
parent
commit
bbf90fc07c

+ 1 - 1
src/DeviceInput/InputDevices/deviceSourceManager.ts

@@ -14,7 +14,7 @@ export class DeviceSource<T extends DeviceType> {
     /**
      * Observable to handle device input changes per device
      */
-    public readonly onInputChangedObservable = new Observable<{ inputIndex: number, previousState: Nullable<number>, currentState: Nullable<number> }>();
+    public readonly onInputChangedObservable = new Observable<{ inputIndex: DeviceInput<T>, previousState: Nullable<number>, currentState: Nullable<number> }>();
 
     // Private Members
     private readonly _deviceInputSystem: DeviceInputSystem;

+ 2 - 2
src/DeviceInput/deviceInputSystem.ts

@@ -188,7 +188,7 @@ export class DeviceInputSystem implements IDisposable {
         this._pointerMoveEvent = ((evt) => {
             const deviceType = (evt.pointerType == "mouse") ? DeviceType.Mouse : DeviceType.Touch;
             const deviceSlot = (evt.pointerType == "mouse") ? 0 : evt.pointerId;
-            
+
             if (!this._inputs[deviceType]) {
                 this._inputs[deviceType] = [];
             }
@@ -276,7 +276,7 @@ export class DeviceInputSystem implements IDisposable {
             if (this._gamepads) {
                 const deviceType = this._getGamepadDeviceType(evt.gamepad.id);
                 const deviceSlot = evt.gamepad.index;
-                
+
                 this._unregisterDevice(deviceType, deviceSlot);
                 delete this._gamepads[deviceSlot];
             }

+ 2 - 0
src/DeviceInput/index.ts

@@ -1,4 +1,6 @@
 export * from "./deviceInputSystem";
 export * from "./InputDevices/deviceEnums";
 export * from "./InputDevices/deviceSourceManager";
+
+import "./InputDevices/deviceTypes";
 export * from "./InputDevices/deviceTypes";