Builtin Library
README.md
gui.clickElement
Click a UI element by its elementTree id - a real pointer down+up at the centre of the part of it the last frame drew, so it works on any widget that frame drew without an author-assigned callback. Resolve ids with gui.elementTree. Pair with gui.captureElement to see the result.
A layout rect exists for every widget the layout measured, drawn or not, and a pointer sent to one the frame left undrawn goes to whatever the frame put there instead. So the press is sent only while ui.diagnose(id) reports painted; any other verdict comes back as { ok = false, id, x, y, reason, detail, error }, carrying that verdict, the sentence it explains itself with, and the point the aim resolved to. A scroll area or an overflow: hidden ancestor can also cut a drawn box down to a band of itself, and the press goes to the middle of that band rather than to the middle of the whole box. gui.clickAt presses a point whatever stands there. The x, y of the answer are the point the press went to, in the logical points gui.bounds and ui.hitTest use, so gui.clickAt(x, y) presses the same place at any ui.pixelRatio().