John Doe <jdoe@usenetlove.invalid> wrote: >def wait_for_keystroke(): > char=0 > while not (char==chr(27) or char==chr(110)): > char=msvcrt.getch() > if char==0: > return > >That freezes the process.
That exact code works perfectly for me. The function returns as soon as I press the escape key. You are running this from a console process, and not a GUI process, right? >That means char=msvcrt.getch() is getting something? Did you ever think about inserting a debug statement to help you? print hex(ord(char)) -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list