def METHOD_NAME(self, event):
    if self.current_point is not None:
        mouse_point = (int(event.ydata), int(event.xdata))
        if event.key == "s":
            self.path = self.LineDDA(self.current_point, mouse_point)
        else:
            self.path = self.compute_shortest_path(self.current_point, mouse_point)
        if self.current_path_plot is not None:
            self.current_path_plot.pop(0).remove()
        self.current_path_plot = plt.plot(self.path[:, 1], self.path[:, 0])
        plt.draw()