TypewriterActionMouse

TYPE DEFINITION

Represents the user clicking somewhere in the text, moving the cursor to the position.

Since 1.2.0

Extends BaseTypewriterAction

Properties

  • position

    number

    The position the mouse click moves the cursor to.

    Since 1.2.0

  • selection Optional

    TypewriterCursorSelection

    Optionally the selection the mouse made when clicking.

    Normally there are two ways a someone can create selections with a mouse: the first is clicking and dragging the mouse, the second is double clicking on a word.

    The idea is that the selection covers the second use-case: double clicking on a word. In the animation you will see the selection happen instantly.

    For first use-case: mouse click selection, it is better to use a keyboard event using ⇧← or ⇧→. This way you animate the selection growing.

    Since 1.2.0

  • type

    "mouse"

    The type signifying it is a mouse event.

    Since 1.2.0