Colibrio Reader Framework API - Cloud license
    Preparing search index...

    The EngineEvent type used for "click" and "contextmenu" events. PointerEngineEvent inherits from this type.

    interface IMouseEngineEvent {
        button: number;
        buttons: number;
        cancelable: boolean;
        clientX: number;
        clientY: number;
        ctrlKey: boolean;
        defaultPrevented: boolean;
        immediatePropagationStopped: boolean;
        isTrusted: boolean;
        mediaResource: IEngineEventMediaResource;
        metaKey: boolean;
        pageX: number;
        pageY: number;
        propagationStopped: boolean;
        readerDocumentEventState: ReaderDocumentEventState;
        readerView: IReaderView;
        relativeClientX: number;
        relativeClientY: number;
        relativeScreenX: number;
        relativeScreenY: number;
        screenX: number;
        screenY: number;
        target: IEngineEventTarget;
        type: keyof IEngineEventTypeMap;
        userGenerated: boolean;
        willEmitDomEvent: boolean;
        preventDefault(): void;
        stopImmediatePropagation(): void;
        stopPropagation(): void;
        toJSON(): IMouseEngineEventData;
    }

    Hierarchy (View Summary)

    Properties

    button: number

    On "pointerdown", "pointerup", and "click" , this property indicates the device button whose state change caused the event to fire. -1: Neither buttons nor touch/pen contact changed since last event. 0: Left Mouse, Touch contact, Pen contact. 1: Middle Mouse. 2: Right Mouse, Pen barrel button. 3: X1 (back) Mouse 4: X2 (forward) Mouse 5: Pen eraser button

    buttons: number

    A number representing which buttons that are pressed on the mouse when a mouse event is triggered. Simultaneous buttons gives a combined value.

    0: No button or un-initialized
    1: Primary button (usually the left button)
    2: Secondary button (usually the right button)
    4: Auxiliary button (usually the mouse wheel button or middle button)
    8: 4th button (typically the "Browser Back" button)
    16 : 5th button (typically the "Browser Forward" button)
    
    cancelable: boolean

    If this event's default action is cancelable. See respective engine event for its definition of default action.

    clientX: number

    The x coordinate in the application's client area.

    clientY: number

    The y coordinate in the application's client area.

    ctrlKey: boolean

    Indicates whether the ctrl key was pressed or not

    defaultPrevented: boolean

    If this event's default action has been canceled/prevented by a call to preventDefault()

    immediatePropagationStopped: boolean

    True if stopImmediatePropagation() was called on this event.

    isTrusted: boolean

    If this event runs in a "trusted" context, i.e. the event callback is executed during a user-generated event such as "click" or "pointerdown".

    If the event was related to a media resource in the publication such as an image, audio or video resource. It contains additional information about the media resource and methods to access media content.

    metaKey: boolean

    Indicates whether the meta key was pressed or not

    pageX: number

    The x coordinate relative the left edge of the application document. This includes any portion of the document not currently visible.

    pageY: number

    The y coordinate relative the top edge of the application document. This includes any portion of the document not currently visible.

    propagationStopped: boolean

    True if stopPropagation() was called on this event.

    readerDocumentEventState: ReaderDocumentEventState

    Describes how the reader document acted on the event.

    readerView: IReaderView

    The ReaderView instance this event is related to.

    relativeClientX: number

    The client X coordinate relative to the window width. Typically a number between 0 and 1.

    relativeClientY: number

    The client Y coordinate relative to the window height. Typically a number between 0 and 1.

    relativeScreenX: number

    The global screen X coordinate relative to the screen width. Typically a number between 0 and 1.

    relativeScreenY: number

    The global screen Y coordinate relative to the screen height. Typically a number between 0 and 1.

    screenX: number

    The x coordinate in global screen coordinates.

    screenY: number

    The y coordinate in global screen coordinates.

    Contains additional information about the original event target, such as the targeted node in the reader document.

    The type of event.

    userGenerated: boolean

    If the event was emitted due to a user generated event.

    Note that if this value is true, the engine event listener might still be called in an untrusted execution context due to proxying through iframes, etc. Use isTrusted() to verify if the current execution context is trusted.

    willEmitDomEvent: boolean

    If true, a native DOM event with the same type as this engine event will also be fired in your app.

    If you are also listening on the corresponding DOM event, use this value to ensure that you are not handling the same event twice.

    For example, when performing a "click" inside an EPUB reader document, the DOM "click" event will not be visible to your app because the document is rendered in an iframe. However, a click on the edge of an EPUB reader document will generate a normal DOM "click" event AND also a Colibrio "click" engine event.

    Methods

    • Prevent the event's default action. See the respective engine event for its definition of default action.

      Returns void

    • Stops this event from propagating to listeners on the ReadingSystemEngine instance, if called from a listener added to a ReaderView instance. If the event has already propagated to the ReadingSystemEngine instance, calling this method has no effect.

      Returns void