class_docstr: Event loop for Windows systems.
  
  :param recognize_paste: When True, try to discover paste actions and turn
      the event into a BracketedPaste.
class_docstr_tok: ["Event","loop","for","Windows","systems",".",":","param","recognize_paste",":","When","True",",","try","to","discover","paste","actions","and","turn","the","event","into","a","BracketedPaste","."]
code: def run(self, stdin, callbacks):
      if self.closed:
          raise Exception("Event loop already closed.")
  
      current_timeout = INPUT_TIMEOUT_MS
      self._running = True
  
      while self._running:
          # Call inputhook.
          with TimeIt() as inputhook_timer:
              if self._inputhook_context:
  
                  def ready(wait):
                      "True when there is input ready. The inputhook should return control."
                      return bool(
                          self._ready_for_reading(
                              current_timeout if wait else 0
                          )
                      )
  
                  self._inputhook_context.call_inputhook(ready)
  
          # Calculate remaining timeout. (The inputhook consumed some of the time.)
          if current_timeout == -1:
              remaining_timeout = -1
          else:
              remaining_timeout = max(
                  0,
                  current_timeout
                  - int(1000 * inputhook_timer.duration),
              )
  
          # Wait for the next event.
          handle = self._ready_for_reading(remaining_timeout)
  
          if handle == self._console_input_reader.handle.value:
              # When stdin is ready, read input and reset timeout timer.
              keys = self._console_input_reader.read()
              for k in keys:
                  callbacks.feed_key(k)
              current_timeout = INPUT_TIMEOUT_MS
  
          elif handle == self._event.value:
              # When the Windows Event has been trigger, process the messages in the queue.
              windll.kernel32.ResetEvent(self._event)
              self._process_queued_calls_from_executor()
  
          elif handle in self._read_fds:
              callback = self._read_fds[handle]
              callback()
          else:
              # Fire input timeout event.
              callbacks.input_timeout()
              current_timeout = -1
  
imports: from __future__ import unicode_literals
  from ..terminal.win32_input import ConsoleInputReader
  from ..win32_types import SECURITY_ATTRIBUTES
  from .base import EventLoop, INPUT_TIMEOUT
  from .inputhook import InputHookContext
  from .utils import TimeIt
  from ctypes import windll, pointer
  from ctypes.wintypes import DWORD, BOOL, HANDLE
  import msvcrt
  import threading
label_desc: Use image node_id 2 for calling the Win32EventLoop obj's underlying member method code with example usage: obj.run(stdin, callbacks) and returns: bool