class_docstr: :param key: A `Keys` instance or text (one character).
  :param data: The received string on stdin. (Often vt100 escape codes.)
code: def __init__(self, key: Keys | str, data: str | None = None) -> None:
      assert isinstance(key, Keys) or len(key) == 1
  
      if data is None:
          if isinstance(key, Keys):
              data = key.value
          else:
              data = key  # 'key' is a one character string.
  
      self.key = key
      self.data = data
  
imports: from __future__ import annotations
  import weakref
  from asyncio import Task, sleep
  from collections import deque
  from typing import TYPE_CHECKING, Any, Generator
  from prompt_toolkit.application.current import get_app
  from prompt_toolkit.enums import EditingMode
  from prompt_toolkit.filters.app import vi_navigation_mode
  from prompt_toolkit.keys import Keys
  from prompt_toolkit.utils import Event
  from .key_bindings import Binding, KeyBindingsBase
label_desc: Use image node_id 1 to create a new KeyPress object  with example: obj = KeyPress(key, data)