Flyclicker
Event-driven desktop automation.
Flyclicker was built to solve a specific problem in a neuroscience lab at the Kavli Institute at UC San Diego. A locomotion-triggered heat stress protocol required an operator to watch a screen and manually interact with the apparatus each time a Drosophila fly moved. Flyclicker replaced that loop — a Python process watches a user-defined screen region, detects pixel-level change against a configurable threshold, and fires the configured click or keystroke automatically.
The first working prototype was validated by running it against online videos before deploying it in the lab. Profiling revealed that the default screenshot resolution was causing CPU usage to spike to ~21% at a sustained 24 fps. Tuning the capture resolution and screenshot frequency brought that down to ~8% without any drop in frame rate — a meaningful improvement for something running as a persistent background process during long experiments.
Reliability came down to the detection threshold. Too sensitive and ambient flicker — lighting shifts, compression artifacts in the feed — triggered false actions; too coarse and real fly movement was missed. Raising the average pixel-difference threshold and iterating on the comparison logic against recorded footage got false positives down to a level the researchers were comfortable running unattended. The prototype was built in about a week and demonstrated to the principal investigator as a workflow improvement, validated on online videos before it touched the actual experiment.