eventFactory.d.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import type { IUIEvent } from "../Events/deviceInputEvents";
  2. import type { Nullable } from "../types";
  3. import { DeviceType } from "./InputDevices/deviceEnums";
  4. import type { IDeviceInputSystem } from "./inputInterfaces";
  5. /**
  6. * Class to wrap DeviceInputSystem data into an event object
  7. */
  8. export declare class DeviceEventFactory {
  9. /**
  10. * Create device input events based on provided type and slot
  11. *
  12. * @param deviceType Type of device
  13. * @param deviceSlot "Slot" or index that device is referenced in
  14. * @param inputIndex Id of input to be checked
  15. * @param currentState Current value for given input
  16. * @param deviceInputSystem Reference to DeviceInputSystem
  17. * @param elementToAttachTo HTMLElement to reference as target for inputs
  18. * @param pointerId PointerId to use for pointer events
  19. * @returns IUIEvent object
  20. */
  21. static CreateDeviceEvent(deviceType: DeviceType, deviceSlot: number, inputIndex: number, currentState: Nullable<number>, deviceInputSystem: IDeviceInputSystem, elementToAttachTo?: any, pointerId?: number): IUIEvent;
  22. /**
  23. * Creates pointer event
  24. *
  25. * @param deviceType Type of device
  26. * @param deviceSlot "Slot" or index that device is referenced in
  27. * @param inputIndex Id of input to be checked
  28. * @param currentState Current value for given input
  29. * @param deviceInputSystem Reference to DeviceInputSystem
  30. * @param elementToAttachTo HTMLElement to reference as target for inputs
  31. * @param pointerId PointerId to use for pointer events
  32. * @returns IUIEvent object (Pointer)
  33. */
  34. private static _CreatePointerEvent;
  35. /**
  36. * Create Mouse Wheel Event
  37. * @param deviceType Type of device
  38. * @param deviceSlot "Slot" or index that device is referenced in
  39. * @param inputIndex Id of input to be checked
  40. * @param currentState Current value for given input
  41. * @param deviceInputSystem Reference to DeviceInputSystem
  42. * @param elementToAttachTo HTMLElement to reference as target for inputs
  43. * @returns IUIEvent object (Wheel)
  44. */
  45. private static _CreateWheelEvent;
  46. /**
  47. * Create Mouse Event
  48. * @param deviceType Type of device
  49. * @param deviceSlot "Slot" or index that device is referenced in
  50. * @param inputIndex Id of input to be checked
  51. * @param currentState Current value for given input
  52. * @param deviceInputSystem Reference to DeviceInputSystem
  53. * @param elementToAttachTo HTMLElement to reference as target for inputs
  54. * @returns IUIEvent object (Mouse)
  55. */
  56. private static _CreateMouseEvent;
  57. /**
  58. * Create Keyboard Event
  59. * @param inputIndex Id of input to be checked
  60. * @param currentState Current value for given input
  61. * @param deviceInputSystem Reference to DeviceInputSystem
  62. * @param elementToAttachTo HTMLElement to reference as target for inputs
  63. * @returns IEvent object (Keyboard)
  64. */
  65. private static _CreateKeyboardEvent;
  66. /**
  67. * Add parameters for non-character keys (Ctrl, Alt, Meta, Shift)
  68. * @param evt Event object to add parameters to
  69. * @param deviceInputSystem DeviceInputSystem to pull values from
  70. */
  71. private static _CheckNonCharacterKeys;
  72. /**
  73. * Create base event object
  74. * @param elementToAttachTo Value to use as event target
  75. * @returns
  76. */
  77. private static _CreateEvent;
  78. }