ESCape problem with tetris/tetrix game

Karl F. Fox karl at zip.UUCP
Tue Dec 5 11:10:30 AEST 1989


In article <24708 at cup.portal.com> thad at 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 at MorningStar.COM



More information about the Unix-pc.general mailing list