Expand description
Coordinate-space conversion — the part most tools get wrong.
A pixelcoords session records physical pixels plus each monitor’s
DPI scale. Input APIs disagree about what they want:
| Platform | Input API speaks |
|---|---|
macOS (CGEvent) | logical points, global space, origin top-left |
Windows (SendInput) | physical pixels, normalized across the virtual desktop |
Linux/X11 (XTEST) | physical pixels on the root window |
So the same saved coordinate needs a different conversion per platform. Getting this wrong doesn’t error — it clicks the wrong place, which is why the conversion lives here, alone, and is property-tested.
Structs§
- Resolved
Point - A point in a named space, carrying the monitor it was resolved against so a caller can report — or re-derive — the conversion.
Enums§
- Space
- The coordinate space a consumer wants a point in.
Functions§
- corners
- Every monitor’s four corners, converted into
space. - monitor_
at - Which monitor contains a global physical point.
- native_
space - The space
Space::Autoresolves to on the platform this was compiled for. Stated once — and not here. - near_
screen_ corner - Whether a point already expressed in
spacesits withinmarginof any monitor’s corner. - to_
space - Convert a global physical point into
space, using the scale of the monitor that contains it.