DrawingManager exposes sixteen public events so hosts can react to user interaction without polling. They fall into four groups: component, diagram, line and lifecycle events. All of them are raised on the UI thread during input processing.

Component Events

Raised when the pointer interacts with a component. All four use ComponentInteractionEventArgs.

EventRaised when
ComponentClickedA component is single-clicked.
ComponentDoubleClickedA component is double-clicked (typical drill-down hook).
ComponentRightClickedA component is right-clicked (context-menu hook).
ComponentHoverChangedThe pointer enters or leaves a component.

Diagram Events

Raised when the pointer interacts with empty canvas space. They use DiagramInteractionEventArgs.

EventRaised when
DiagramClickedEmpty canvas is clicked (selection-clear hook).
DiagramDoubleClickedEmpty canvas is double-clicked.
DiagramRightClickedEmpty canvas is right-clicked (canvas context menu).

Line Events

Raised for connection lines. They use LineInteractionEventArgs, which carries the Line and an IsArrowClick flag so hosts can distinguish a click on the arrowhead from a click on the stroke.

EventRaised when
LineClickedA connection line is clicked.
LineDoubleClickedA connection line is double-clicked (label editing hook).
LineRightClickedA connection line is right-clicked.
LineHoverChangedThe pointer enters or leaves a line.

Lifecycle Events

EventArgumentsRaised when
ComponentDroppedComponentDropEventArgsA component drag ends; carries canvas and screen positions plus final bounds.
SelectionChangedEventArgsThe selection set changes (select, add, clear, delete).
HistoryChangedEventArgsAn undoable action is pushed, undone or redone.
SaveRequestedEventArgsA save is requested through the manager (for example from a keyboard shortcut).
DrawSurfaceConnectionEventArgsA frame has been drawn; the host can paint overlays.

Event Arguments

Interaction arguments share a common shape: positions in both canvas and screen space, the mouse button and key modifiers, an InteractionType, a settable Handled flag and a free Tag slot.

MemberAvailable onDescription
ComponentComponent argsThe component involved in the interaction.
LineLine argsThe connection line involved.
CanvasPositionAllPointer position in world coordinates.
ScreenPositionAllPointer position in screen coordinates.
MouseButtonAllButton index that triggered the event.
ModifiersAllSKKeyModifiers active at the time.
InteractionTypeAllWhich interaction produced the event (see below).
IsArrowClickLine argsTrue when the arrowhead was hit rather than the stroke.
HandledAllSet to true to mark the interaction consumed.
TagAllCaller-defined payload.

InteractionType

Click, DoubleClick, RightClick, MiddleClick, HoverEnter, HoverLeave, Hover, DragStart, Dragging, DragEnd.

Handling Pattern

// Drill down on double-click
drawingManager.ComponentDoubleClicked += (s, e) =>
{
    if (e.Component is ProcessNode process)
    {
        e.Handled = true;
        OpenDetail(process);
    }
};

// Canvas context menu
drawingManager.DiagramRightClicked += (s, e) =>
{
    ShowCanvasMenu(e.ScreenPosition);
};

// Edit a line label on double-click
drawingManager.LineDoubleClicked += (s, e) =>
{
    if (e.IsArrowClick) return;
    BeginLabelEdit(e.Line, e.ScreenPosition);
};

// Track undo availability in the UI
drawingManager.HistoryChanged += (s, e) =>
{
    undoButton.Enabled = drawingManager.CanUndo;
    redoButton.Enabled = drawingManager.CanRedo;
};

// React to drops (for example, snap-into-container logic)
drawingManager.ComponentDropped += (s, e) =>
{
    if (e.Component is CardNode && !containerBounds.Contains(e.CanvasPosition))
        e.Component.X = containerBounds.Left + 12;
};

The types under Beep.Skia.Events (ComponentClickEventArgs, DiagramClickEventArgs, LineClickEventArgs, HoverChangedEventArgs) are public but not raised by the manager; they exist as a simpler payload shape for host code. Use the interaction argument types above for manager events.