This mechanism converts linear reciprocating motion of green slider into intermittent rotation of yellow gear.
Blue rack, orange rockers create a parallelogram mechanism.
Red leaf spring always forces the rack toward the gear.
Pay attention to the positions of red stoppers at the ends of the green slider.
Load on the gear keeps it immobile when the slider moves to the left.