class_docstr: This is an input pipe that works on Windows.
  Text or bytes can be feed into the pipe, and key strokes can be read from
  the pipe. This is useful if we want to send the input programmatically into
  the application. Mostly useful for unit testing.
  
  Notice that even though it's Windows, we use vt100 escape sequences over
  the pipe.
  
  Usage::
  
      input = Win32PipeInput()
      input.send_text('inputdata')
class_docstr_tok: ["This","is","an","input","pipe","that","works","on","Windows",".","Text","or","bytes","can","be","feed","into","the","pipe",",","and","key","strokes","can","be","read","from","the","pipe",".","This","is","useful","if","we","want","to","send","the","input","programmatically","into","the","application",".","Mostly","useful","for","unit","testing",".","Notice","that","even","though","it","'s","Windows",",","we","use","vt100","escape","sequences","over","the","pipe",".","Usage",":",":","input","=","Win32PipeInput","(",")","input.send_text","(","'inputdata","'",")"]
code: def __init__(self, _event: HANDLE) -> None:
      super().__init__()
      # Event (handle) for registering this input in the event loop.
      # This event is set when there is data available to read from the pipe.
      # Note: We use this approach instead of using a regular pipe, like
      #       returned from `os.pipe()`, because making such a regular pipe
      #       non-blocking is tricky and this works really well.
      self._event = create_win32_event()
  
      self._closed = False
  
      # Parser for incoming keys.
      self._buffer: list[
          KeyPress
      ] = []  # Buffer to collect the Key objects.
      self.vt100_parser = Vt100Parser(
          lambda key: self._buffer.append(key)
      )
  
      # Identifier for every PipeInput for the hash.
      self.__class__._id += 1
      self._id = self.__class__._id
  
imports: from __future__ import annotations
  import sys
  from contextlib import contextmanager
  from ctypes import windll
  from ctypes.wintypes import HANDLE
  from typing import Callable, ContextManager, Iterator
  from prompt_toolkit.eventloop.win32 import create_win32_event
  from ..key_binding import KeyPress
  from ..utils import DummyContext
  from .base import PipeInput
  from .vt100_parser import Vt100Parser
  from .win32 import _Win32InputBase, attach_win32_input, detach_win32_input
label_desc: Use image node_id 1 to create a new Win32PipeInput object from inherited base classes: _Win32InputBase, PipeInput with example: obj = Win32PipeInput(_event)