def poll_event(self):
        """
        Waits for an event to happen and returns a string related to the event.

        If the event is a normal (letter) key press, the letter is returned (case sensitive)

        :return: Event type
        """
        # Flush all inputs before this one that were done since last poll
        curses.flushinp()

        ch = self.screen.getch()

        if ch == 27:
            return EVENT_ESC
        elif ch == -1 or ch == curses.KEY_RESIZE:
            return EVENT_RESIZE
        elif ch == 10 or ch == curses.KEY_ENTER:
            return EVENT_ENTER
        elif ch == 127 or ch == curses.KEY_BACKSPACE:
            return EVENT_BACKSPACE
        elif ch == curses.KEY_UP:
            return EVENT_UP
        elif ch == curses.KEY_DOWN:
            return EVENT_DOWN
        elif ch == curses.KEY_LEFT:
            return EVENT_LEFT
        elif ch == curses.KEY_RIGHT:
            return EVENT_RIGHT
        elif ch == 3:
            return EVENT_CTRL_C
        elif 0 <= ch < 256:
            return chr(ch)
        else:
            return EVENT_UNHANDLED
def poll_event ( self ) : curses . flushinp ( ) ch = self . screen . getch ( ) if ch == 27 : return EVENT_ESC elif ch == - 1 or ch == curses . KEY_RESIZE : return EVENT_RESIZE elif ch == 10 or ch == curses . KEY_ENTER : return EVENT_ENTER elif ch == 127 or ch == curses . KEY_BACKSPACE : return EVENT_BACKSPACE elif ch == curses . KEY_UP : return EVENT_UP elif ch == curses . KEY_DOWN : return EVENT_DOWN elif ch == curses . KEY_LEFT : return EVENT_LEFT elif ch == curses . KEY_RIGHT : return EVENT_RIGHT elif ch == 3 : return EVENT_CTRL_C elif 0 <= ch < 256 : return chr ( ch ) else : return EVENT_UNHANDLED
Waits for an event to happen and returns a string related to the event.

        If the event is a normal (letter) key press, the letter is returned (case sensitive)

        :return: Event type