class_docstr: Vt100 input for Posix systems.
  (This uses a posix file descriptor that can be registered in the event loop.)
docstr: Flush pending keys and return them.
  (Used for flushing the 'escape' key.)
docstr_tok: ["Flush","pending","keys","and","return","them",".","(","Used","for","flushing","the","'escape","'","key",".",")"]
code: def flush_keys(self) -> list[KeyPress]:
      """
      Flush pending keys and return them.
      (Used for flushing the 'escape' key.)
      """
      # Flush all pending keys. (This is most important to flush the vt100
      # 'Escape' key early when nothing else follows.)
      self.vt100_parser.flush()
  
      # Return result.
      result = self._buffer
      self._buffer = []
      return result
  
imports: from __future__ import annotations
  import sys
  import contextlib
  import io
  import termios
  import tty
  from asyncio import AbstractEventLoop, get_running_loop
  from typing import Callable, ContextManager, Generator, TextIO
  from ..key_binding import KeyPress
  from .base import Input
  from .posix_utils import PosixStdinReader
  from .vt100_parser import Vt100Parser
label_desc: Use image node_id 5 for calling the Vt100Input obj's underlying member method code with example usage: obj.flush_keys() and returns: result