Module position_debounce

Module position_debounce 

Source

Constants§

DEBOUNCE_MS 🔒
Maximum frequency at which any single HWND will produce a position report. Currently 50ms ≈ 20 Hz.

Functions§

forget
Phase B.9.1 — drop the debounce entry for an HWND. Called from the destroy hook so a recycled HWND value doesn’t inherit the previous occupant’s debounce state.
map 🔒
Per-HWND last-emit time. Lock is held only for HashMap operations — never across IPC. Mutex-poisoning is treated as unrecoverable (poison = a panic in the WRR hook callback, which means the hook is broken anyway); we recover via into_inner so the next caller starts fresh.
should_emit
Phase B.9.1 — should we emit a position report for this HWND right now? Returns true if at least DEBOUNCE_MS has elapsed since the last emit for this HWND (or this is the first emit for it). Updates the timestamp atomically with the decision.