code: def wait(button=LEFT, target_types=(UP, DOWN, DOUBLE)):
      
      from threading import Lock
      lock = Lock()
      lock.acquire()
      handler = on_button(lock.release, (), [button], target_types)
      lock.acquire()
      _listener.remove_handler(handler)
docs: Blocks program execution until the given button performs an event.