handle_click function

Handle mouse actions on marks.