hammerspoon2-docs
    Preparing search index...

    Function makeMouseEvent

    • Create a mouse event at the given position. Coordinates are in Hammerspoon screen coordinates (top-left origin of the primary display, y increases downward), matching the values returned by hs.screen.

      Parameters

      • type: number

        An event type integer from hs.eventtap.eventTypes (e.g. leftMouseDown)

      • x: number

        Horizontal position in Hammerspoon screen coordinates

      • y: number

        Vertical position in Hammerspoon screen coordinates

      • button: number

        Mouse button number (0=left, 1=right, 2=middle)

      Returns HSEventTapEvent | null

      An HSEventTapEvent, or null if the event could not be created