Cam mechanism for a pen

 From:  yakas
5591.1 
Hi everyone. I am trying to wrap my head around designing a functioning cam for a pen click mechanism. Does anyone have any pointers. Modeling it is no problem, but creating a properly functioning cam shape seems as if there should be some rules to follow.

Thanks