[keypress] Let 'q' quit, and disable quitting for all other keys.

master
Daniel Edgecumbe 7 years ago
parent 6d9b4dbb21
commit 2aec076015

@ -26,10 +26,13 @@ async def keypress_loop(window, callback, resize_callback):
await resize_callback(y, x)
return
if len(key) == 1 and key.lower() == "q":
raise Exception("Quitting.")
key = await callback(key)
if key is not None:
# hand off key to somewhere else.
raise Exception
# Unhandled key. Don't care.
pass
first = True
while True:

Loading…
Cancel
Save