'Key press event handler'

def _on_key_press(self, event):

    if ((not self._polygon_completed) and ((u'move_vertex' in self.state) or (u'move_all' in self.state))):
        (self._xs, self._ys) = (self._xs[:(-1)], self._ys[:(-1)])
        self._draw_polygon()
