babylon.keyboardEvents.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. module BABYLON {
  2. export class KeyboardEventTypes {
  3. static _KEYDOWN = 0x01;
  4. static _KEYUP = 0x02;
  5. public static get KEYDOWN(): number {
  6. return KeyboardEventTypes._KEYDOWN;
  7. }
  8. public static get KEYUP(): number {
  9. return KeyboardEventTypes._KEYUP;
  10. }
  11. }
  12. export class KeyboardInfo {
  13. constructor(public type: number, public event: KeyboardEvent) {
  14. }
  15. }
  16. /**
  17. * This class is used to store keyboard related info for the onPreKeyboardObservable event.
  18. * Set the skipOnKeyboardObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onKeyboardObservable
  19. */
  20. export class KeyboardInfoPre extends KeyboardInfo {
  21. constructor(type: number, event: KeyboardEvent) {
  22. super(type, event);
  23. this.skipOnPointerObservable = false;
  24. }
  25. public skipOnPointerObservable: boolean;
  26. }
  27. }