Path: utzoo!utgpu!watserv1!watmath!uunet!ukma!mailrus!shadooby!samsung!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!mstar!zip!karl From: karl@zip.UUCP (Karl F. Fox) Newsgroups: unix-pc.general Subject: Re: ESCape problem with tetris/tetrix game Message-ID: <1989Dec5.001030.5777@zip.UUCP> Date: 5 Dec 89 00:10:30 GMT References: <24708@cup.portal.com> Reply-To: karl@zip.UUCP (Karl F. Fox) Organization: Zip. Lines: 38 In article <24708@cup.portal.com> thad@cup.portal.com (Thad P Floryan) writes: ... >But I did discover a strange problem occurring ONLY with tetrix, and it >concerns restoring the proper tty modes after the game. Specifically, after >playing tetrix, the ESCape key is fooled into sending TWO instead of ONE >escape for each depression. I first thought it was a problem with my keyboard, >but simply logging out and logging back in cured the problem. Anyone know what this is for? I didn't see any mention of it in window(7), but curses must find it useful: % grep ESC /usr/include/sys/window.h #define WIOCSESC (WIOC|17) /* set double esc mode */ Also, from curses(3x): "In order to initialize the routines, the routine initscr() or newterm() must be called before any of the other routines that deal with windows and screens are used. [...] The routine endwin() must be called before exiting." Apply this patch: Index: tet.c *** tet.c.ORIG Mon Dec 4 18:57:42 1989 --- tet.c Mon Dec 4 18:58:19 1989 *************** *** 409,414 **** --- 409,415 ---- mvaddstr(22,48,"Tetrix says Bye\n"); mvaddstr(23,0,""); refresh(); + endwin(); sleep(1); ioctl (0, TCSETA, &origtty); exit(0); -- Karl F. Fox, Morning Star Technologies, Inc. karl@MorningStar.COM