Moved a get_input to util. Fixed method stop

This commit is contained in:
Crista Lopes
2013-10-17 21:24:10 -07:00
parent d9ff0f84bd
commit d01a224ae9
2 changed files with 19 additions and 17 deletions

View File

@@ -59,3 +59,17 @@ def cls():
os.system(['clear','cls'][os.name == 'nt'])
interactive = True
def get_input():
global interactive
if not interactive:
return True
while True:
key = ord(getch())
if key == 32: # space bar
return True
elif key == 27: # ESC
interactive = False
return True