@cartridge-engine/keyboard-engine
    Preparing search index...

    Type Alias EventByAction<T>

    EventByAction: MouseEventBase & (
        T extends "wheel"
            ? {
                action: T;
                button: "wheel-up"
                | "wheel-down"
                | "wheel-left"
                | "wheel-right";
            }
            : T extends "move"
                ? { action: T; button: "none" }
                : T extends "click"
                    ? {
                        action: T;
                        button: | "left"
                        | "middle"
                        | "right"
                        | "wheel-up"
                        | "wheel-down"
                        | "wheel-left"
                        | "wheel-right";
                    }
                    : T extends "drag"
                        ? {
                            action: T;
                            button: Exclude<ButtonType, (...) | (...) | (...) | (...) | (...)>;
                        }
                        : T extends "press"
                        | "release"
                            ? { action: T; button: ButtonType }
                            : never
    ) & Pick<XtermMouseEvent, "protocol">

    Extracts the base properties from MouseEvent and infers action-specific button types. This creates discriminated unions based on the action type.

    For example:

    • 'wheel' events always have button='wheel-*'
    • 'move' events always have button='none'
    • 'click' events are synthesized with specific button types
    • 'drag' events have actual button types (not wheel buttons)

    Type Parameters