Class TextEditorViewKeyboardEvent

Keyboard Events

When a keyboard event is fired, it is wrapped in a TextEditorViewKeyboardEvent object. This object provides a more convenient interface for dealing with keyboard events - which avoids the need to perform string comparisons on key codes in other parts of the code.

Also, it makes the event immutable, which is important because the event is passed to multiple handlers. If the event were mutable, then one handler could modify the event in a way that affects other handlers.

These event details can be used when developing an Input Processor to determine which key was pressed. See: Processors.

Hierarchy

  • TextEditorViewKeyboardEvent

Constructors

Accessors

  • get isCopy(): boolean
  • True if the given event represents a standard 'copy' keyboard sequence.

    Returns

    True if the given event represents a standard 'copy' keyboard sequence.

    Returns boolean

  • get isMutatingInput(): boolean
  • True if the event represents a keyboard sequence that is likely going to mutate the contents of the editor directly in some way and should be recorded in the undo/redo history. If this method ever returns false for a keyboard sequence that does mutate the editor, the undo/redo history will be corrupted.

    Returns

    True if the event represents a keyboard sequence that is likely going to mutate the contents of the editor directly.

    Returns boolean

  • get isPaste(): boolean
  • True if the given event represents a standard 'paste' keyboard sequence.

    Returns

    True if the given event represents a standard 'paste' keyboard sequence.

    Returns boolean

  • get isRedo(): boolean
  • True if the given event represents a standard 'redo' keyboard sequence.

    Returns

    True if the given event represents a standard 'redo' keyboard sequence.

    Returns boolean

  • get isUndo(): boolean
  • True if the given event represents a standard 'undo' keyboard sequence.

    Returns

    True if the given event represents a standard 'undo' keyboard sequence.

    Returns boolean

  • get keyCode(): string
  • Obtains the key code from a keyboard event. All key codes are converted to uppercase.

    Returns

    Obtains the key code from a keyboard event (uppercase).

    Returns string

Generated using TypeDoc