hammerspoon2-docs
    Preparing search index...

    Namespace mouse

    Control and inspect the mouse pointer and attached mouse devices.

    All coordinates use Hammerspoon screen coordinates: (0, 0) is at the top-left of the primary display and y increases downward.

    const pos = hs.mouse.absolutePosition()
    console.log("Mouse at " + pos.x + ", " + pos.y)

    hs.mouse.setAbsolutePosition(100, 200)
    console.log("Mice: " + hs.mouse.count())
    hs.mouse.names().forEach(n => console.log(n))
    console.log(hs.mouse.currentCursorType())   // e.g. "arrow"
    console.log(hs.mouse.scrollDirection()) // "natural" or "normal"

    Functions

    absolutePosition
    count
    currentCursorType
    getCurrentScreen
    getRelativePosition
    names
    scrollDirection
    setAbsolutePosition
    setRelativePosition
    setTrackingSpeed
    trackingSpeed