Reds are pivots.
Yellow is the fixed pawl that you showed in your diagram.
Black line represents a pivoting pawl, and the blue dots are stops to limit the pivoting pawls travel. The pawl is held to the left with a spring.
The pivoting pawl is attached to the shift arm. The shift arm is free to pivot at the left, and would be sprung downward(not pictured).
Starting in the rest position (the lower drawing), as the shift arm is raised at it's right side, the pivoting pawl will lift the rack up off of the fixed pawl, at which point the pivoting pawl will move to the right and stop on it's stop, allowing the rack to only move right almost one full tooth.
When the shift arm is left back down, the rack will rest on the fixed pawl just before the next tooth, and as the shift arm continues downward, the pivoting pawl will be pulled out of it's rack tooth and it's spring will re-set the pawl for the next shift.
Part shapes are just to explain the function.
I have a few ideas on some simple construction to keep the teeth in line with each other so they aren't dependant on tight pivots to prevent the teeth from splaying off to the side of each other.