iink-ts - v4.0.0
    Preparing search index...

    Class IIKeyboardManager

    Manages keyboard input for the Interactive Ink canvas Handles tool switching via modifier keys (Ctrl/Cmd for Move mode)

    Hierarchy (View Summary)

    Index

    The Interactive Ink Canvas instance

    logger: Logger

    Logger instance for this manager Automatically uses LoggerCategory.MANAGER

    managerName: string = "IIKeyboardManager"

    Name of the manager for logging purposes Must be overridden in concrete classes

    "IITypesetManager", "IIMathManager"
    
    PAN_STEP: 100
    ZOOM_STEP: 1.2
    • get client(): WebSocketClient

      Get the client from the canvas Convenience getter to avoid accessing canvas.client everywhere

      Returns WebSocketClient

    • get model(): IIModel

      Get the model from the canvas Convenience getter to avoid accessing canvas.model everywhere

      Returns IIModel

    • get renderer(): SVGRenderer

      Get the renderer from the canvas Convenience getter to avoid accessing canvas.renderer everywhere

      Returns SVGRenderer

    • Attach keyboard event listeners to the window

      Returns void

    • Destroy the manager and cleanup resources Calls the onDestroy hook if defined

      Returns void

    • Detach keyboard event listeners from the window

      Returns void

    • Handle keydown events Handles copy/paste/cut shortcuts and Delete key; switches to Move tool when Ctrl/Cmd is pressed

      Parameters

      • event: KeyboardEvent

      Returns void

    • Handle keyup events Restores previous tool when Ctrl/Cmd is released

      Parameters

      • event: KeyboardEvent

      Returns void

    • Lifecycle hook called when the manager is being destroyed Override in subclasses to cleanup resources

      Returns void

      protected onDestroy(): void {
      this.logger.info(`${this.managerName} destroyed`)
      // Remove event listeners, clear intervals, etc.
      }
    • Lifecycle hook called after manager initialization Override in subclasses if needed

      This is called at the end of the constructor, allowing subclasses to perform initialization that requires access to this.managerName or other properties set in the subclass constructor.

      Returns void

      protected onInit(): void {
      this.logger.info(`${this.managerName} initialized`)
      // Setup event listeners, etc.
      }
    • Reset the stored tool when user manually changes tool Called by the canvas when tool changes programmatically

      Returns void