Converting Two Way Linear Motion Into One Way Rotation

Input: yellow slider linearly reciprocating with constant stroke length.
Output: blue shaft rotating continuously.
Upper figure shows developed groove of the blue shaft.
Key factor: upper and lower profiles of the groove are different to ensure the output one-way rotation.
This mechanism can also convert rotary motion into linear reciprocating one.