Half of red ball is in circular groove on yellow button, the other half is in internal zigzag groove of grey bush.
Each button push gives one among its two axial positions.
Figure on the right is developed groove of the grey bush.
The button or the bush has assembly structure (not shown) for putting the ball into the grooves.