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