keyboardEvents.d.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import type { IKeyboardEvent } from "./deviceInputEvents";
  2. /**
  3. * Gather the list of keyboard event types as constants.
  4. */
  5. export declare class KeyboardEventTypes {
  6. /**
  7. * The keydown event is fired when a key becomes active (pressed).
  8. */
  9. static readonly KEYDOWN = 1;
  10. /**
  11. * The keyup event is fired when a key has been released.
  12. */
  13. static readonly KEYUP = 2;
  14. }
  15. /**
  16. * This class is used to store keyboard related info for the onKeyboardObservable event.
  17. */
  18. export declare class KeyboardInfo {
  19. /**
  20. * Defines the type of event (KeyboardEventTypes)
  21. */
  22. type: number;
  23. /**
  24. * Defines the related dom event
  25. */
  26. event: IKeyboardEvent;
  27. /**
  28. * Instantiates a new keyboard info.
  29. * This class is used to store keyboard related info for the onKeyboardObservable event.
  30. * @param type Defines the type of event (KeyboardEventTypes)
  31. * @param event Defines the related dom event
  32. */
  33. constructor(
  34. /**
  35. * Defines the type of event (KeyboardEventTypes)
  36. */
  37. type: number,
  38. /**
  39. * Defines the related dom event
  40. */
  41. event: IKeyboardEvent);
  42. }
  43. /**
  44. * This class is used to store keyboard related info for the onPreKeyboardObservable event.
  45. * Set the skipOnKeyboardObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onKeyboardObservable
  46. */
  47. export declare class KeyboardInfoPre extends KeyboardInfo {
  48. /**
  49. * Defines the type of event (KeyboardEventTypes)
  50. */
  51. type: number;
  52. /**
  53. * Defines the related dom event
  54. */
  55. event: IKeyboardEvent;
  56. /**
  57. * Defines whether the engine should skip the next onKeyboardObservable associated to this pre.
  58. */
  59. skipOnKeyboardObservable: boolean;
  60. /**
  61. * Defines whether the engine should skip the next onKeyboardObservable associated to this pre.
  62. * @deprecated use skipOnKeyboardObservable property instead
  63. */
  64. get skipOnPointerObservable(): boolean;
  65. set skipOnPointerObservable(value: boolean);
  66. /**
  67. * Instantiates a new keyboard pre info.
  68. * This class is used to store keyboard related info for the onPreKeyboardObservable event.
  69. * @param type Defines the type of event (KeyboardEventTypes)
  70. * @param event Defines the related dom event
  71. */
  72. constructor(
  73. /**
  74. * Defines the type of event (KeyboardEventTypes)
  75. */
  76. type: number,
  77. /**
  78. * Defines the related dom event
  79. */
  80. event: IKeyboardEvent);
  81. }