def on_click(self, event):
if event["<STR_LIT>"] == <NUM_LIT:1>:<EOL><INDENT>if self._running:<EOL><INDENT>self._running = False<EOL>self._time_left = self._end_time - time()<EOL>if self._timer:<EOL><INDENT>self._timer.cancel()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._running = True<EOL>self._end_time = time() + self._time_left<EOL>if self._timer:<EOL><INDENT>self._timer.cancel()<EOL><DEDENT>self._timer = Timer(self._time_left, self._time_up)<EOL>self._timer.start()<EOL>if self._active:<EOL><INDENT>self.py3.play_sound(self.sound_pomodoro_start)<EOL><DEDENT><DEDENT><DEDENT>elif event["<STR_LIT>"] == <NUM_LIT:2>:<EOL><INDENT>self._init()<EOL>if self._timer:<EOL><INDENT>self._timer.cancel()<EOL><DEDENT><DEDENT>elif event["<STR_LIT>"] == <NUM_LIT:3>:<EOL><INDENT>self._advance(user_action=True)<EOL>if self._timer:<EOL><INDENT>self._timer.cancel()<EOL><DEDENT><DEDENT>
Handles click events:
    - left click starts an inactive counter and pauses a running
      Pomodoro
    - middle click resets everything
    - right click starts (and ends, if needed) a break