The green barrel cam has two grooves. Motion of the yellow slider can be altered by rotating the orange gear to let one of two rack’s rollers come into contact with its corresponding cam’s groove.
The positioning device for the orange gear is not shown.