Skip to main content

Module click_capture

Module click_capture 

Source
Expand description

Click telemetry capture (ED.17 / ISS-16 / M-EDIT).

Records where the user clicked during a recording so the editor can drive the already-tested auto-zoom generator (auto_zoom_segments) and the ED.19 click ripples. It is the companion to cursor_capture: that module captures the cursor position track with no permission; this one captures the click log, which needs more.

§Why a tap, and why it’s runtime-only

Unlike the cursor position (readable with CGEventCreate(NULL)), clicks must be observed through a CGEventTap — a listen-only system event tap for left/right mouse-down. A tap requires the Input-Monitoring permission (the OS prompts the user; it cannot be granted in CI/headless) and a CFRunLoop to pump the tap’s mach-port source. So the live tap is runtime-only: there is no automated test for the capture itself. What is exhaustively tested is the pure arithmetic either side of it — samples_to_clicks (timestamp → project-frame mapping) and the RecordingState handoff — plus the non-macOS stub, so the whole module compiles + gate-greens on every OS.

§Graceful degradation

If the tap can’t be created (permission not yet granted) the worker logs and exits cleanly — the recording proceeds, the editor simply gets no click log (auto-zoom stays available as a manual tool). Capture never blocks or fails a recording.

Modules§

imp 🔒

Structs§

ClickTap
Non-macOS stub: click capture is macOS-first (ED.17 / ISS-16). The editor simply gets no click log on other platforms.

Functions§

samples_to_clicks
Resample timestamped clicks ((elapsed_since_start, x, y), normalized to the captured frame, sorted by time) onto the project frame grid: each click’s frame is floor(elapsed_secs · project_fps). Unlike the cursor track, every click is kept (two clicks one frame apart are two real events — the auto-zoom clusterer merges them by time itself). Pure.