docs: def add_event_detect(channel, trigger, callback=None, bouncetime=None):
      """
      This function is designed to be used in a loop with other things, but unlike
      polling it is not going to miss the change in state of an input while the
      CPU is busy working on other things. This could be useful when using
      something like Pygame or PyQt where there is a main loop listening and
      responding to GUI events in a timely basis.
  
      :param channel: the channel based on the numbering system you have specified
          (:py:attr:`GPIO.BOARD`, :py:attr:`GPIO.BCM` or :py:attr:`GPIO.SUNXI`).
      :param trigger: The event to detect, one of: :py:attr:`GPIO.RISING`,
          :py:attr:`GPIO.FALLING` or :py:attr:`GPIO.BOTH`.
      :param callback: (optional) TODO
      :param bouncetime: (optional) TODO
  
      .. code: python
  
         GPIO.add_event_detect(channel, GPIO.RISING)  # add rising edge detection on a channel
         do_something()
         if GPIO.event_detected(channel):
             print('Button pressed')
      """
      _check_configured(channel, direction=IN)
  
      if bouncetime is not None:
          if _gpio_warnings:
              warnings.warn("bouncetime is not (yet) fully supported, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.", stacklevel=2)
  
      pin = get_gpio_pin(_mode, channel)
      event.add_edge_detect(pin, trigger, __wrap(callback, channel))