keypad(stdscr,TRUE);
if (!keypad_on) keypad(LYwin,TRUE);
PUBLIC void start_curses NOARGS{#ifdef USE_SLANG    static int slinit;    if (LYCursesON) {	CTRACE(tfp, "start_curses: Hmm, already ON.\n");	return;    }    if (slinit == 0) {	SLtt_get_terminfo();#if defined(__DJGPP__) && !defined(DJGPP_KEYHANDLER)	SLkp_init ();#endif /* __DJGPP__ && !DJGPP_KEYHANDLER */#ifdef UNIX#if SLANG_VERSION >= 9935	SLang_TT_Read_FD = fileno(stdin);#endif /* SLANG_VERSION >= 9935 */#endif /* UNIX */	/*	 *  Check whether a saved show_color:off override is in effect. - kw	 */	if (LYrcShowColor == SHOW_COLOR_NEVER) {	    SLtt_Use_Ansi_Colors = 0;	}	/*	 *  Check whether we're forcing color on. - FM	 */	if ((LYShowColor > 1) && (Lynx_Color_Flags & SL_LYNX_USE_COLOR))	    SLtt_Use_Ansi_Colors = 1;	/*	 *  Check whether a -nocolor override is in effect. - kw	 */	if (Lynx_Color_Flags & SL_LYNX_OVERRIDE_COLOR)	    SLtt_Use_Ansi_Colors = 0;	/*	 *  Make sure our flags are in register. - FM	 */	if (SLtt_Use_Ansi_Colors == 1) {	    if (LYShowColor != SHOW_COLOR_ALWAYS) {		LYShowColor = SHOW_COLOR_ON;	    }	} else {	    if (LYShowColor != SHOW_COLOR_NEVER) {		LYShowColor = SHOW_COLOR_OFF;	    }	}	size_change(0);#if defined(VMS) || defined(UNIX)	SLtt_add_color_attribute(4, SLTT_ULINE_MASK);	SLtt_add_color_attribute(5, SLTT_ULINE_MASK);	/*	 *  If set, the blink escape sequence will turn on high	 *  intensity background (rxvt and maybe Linux console).	 */	if (LYShowColor && (Lynx_Color_Flags & SL_LYNX_USE_BLINK)) {	    SLtt_Blink_Mode = 1;	} else {	    SLtt_Blink_Mode = 0;	}#endif /* VMS || UNIX */    }#ifdef __DJGPP__    else sock_init();#endif /* __DJGPP__ */    slinit = 1;    Current_Attr = 0;#ifndef VMS#if SLANG_VERSION > 9929    SLang_init_tty(-1, 0, 1);#else    SLang_init_tty(3, 0, 1);#endif /* SLANG_VERSION > 9929 */#endif /* !VMS */    SLsmg_init_smg();    SLsmg_Display_Eight_Bit = LYlowest_eightbit[current_char_set];    if (SLsmg_Display_Eight_Bit > 191)	SLsmg_Display_Eight_Bit = 191; /* may print ctrl chars otherwise - kw */    scrollok(0,0);    SLsmg_Backspace_Moves = 1;#ifndef VMS#if !defined(_WINDOWS) && !defined(__DJGPP__)    SLtty_set_suspend_state(1);#endif /* !_WINDOWS */#ifdef SIGTSTP    if (!no_suspend)	signal(SIGTSTP, sl_suspend);#endif /* SIGTSTP */    signal(SIGINT, cleanup_sig);#endif /* !VMS */   lynx_enable_mouse (1);#else /* Using curses: */#ifdef VMS    /*     *	If we are VMS then do initscr() everytime start_curses()     *	is called!     */    initscr();	/* start curses */#else  /* Unix: */    static BOOLEAN first_time = TRUE;    if (first_time) {	/*	 *  If we're not VMS then only do initscr() one time,	 *  and one time only!	 */	if (initscr() == NULL) {  /* start curses */	    fprintf(tfp, "%s\n",		gettext("Terminal initialisation failed - unknown terminal type?"));	    exit_immediately (-1);	}#if defined(SIGWINCH) && defined(NCURSES_VERSION)	size_change(0);	recent_sizechange = FALSE; /* prevent mainloop drawing 1st doc twice */#endif /* SIGWINCH */#if defined(USE_KEYMAPS) && defined(NCURSES_VERSION)	if (-1 == lynx_initialize_keymaps ())	    exit (-1);#endif	/*	 * This is a workaround for a bug in SVr4 curses, observed on Solaris	 * 2.4:  if your terminal's alternate-character set contains codes in	 * the range 128-255, they'll be sign-extended in the acs_map[] table,	 * which in turn causes their values to be emitted as 255 (0xff).	 * "Fix" this by forcing the table to 8-bit codes (it has to be	 * anyway).	 */#if defined(ALT_CHAR_SET) && !defined(NCURSES_VERSION)	{	    int n;	    for (n = 0; n < 128; n++)		if (ALT_CHAR_SET[n] & 0x80) {		    ALT_CHAR_SET[n] &= 0xff;		    ALT_CHAR_SET[n] |= A_ALTCHARSET;		}	}#endif#if defined(USE_COLOR_STYLE) || defined(USE_COLOR_TABLE)	if (has_colors()) {	    lynx_has_color = TRUE;	    start_color();#if HAVE_USE_DEFAULT_COLORS	    if (use_default_colors() == OK) {		default_fg = DEFAULT_COLOR;		default_bg = DEFAULT_COLOR;	    }#endif /* HAVE_USE_DEFAULT_COLORS */	}#endif /* USE_COLOR_STYLE || USE_COLOR_TABLE */#ifdef USE_COLOR_STYLE	parse_userstyles();#endif	first_time = FALSE;#if USE_COLOR_TABLE	lynx_init_colors();	lynx_called_initscr = TRUE;#endif /* USE_COLOR_TABLE */    }#ifdef __DJGPP__    else sock_init();#endif /* __DJGPP__ */#endif /* not VMS */    /* nonl();	 */ /* seems to slow things down */#ifdef VMS    crmode();    raw();#else#if HAVE_CBREAK    cbreak();#else    crmode();#endif /* HAVE_CBREAK */    signal(SIGINT, cleanup_sig);#endif /* VMS */    noecho();#if HAVE_KEYPAD    keypad(stdscr,TRUE);#endif /* HAVE_KEYPAD */   lynx_enable_mouse (1);    fflush(stdin);    fflush(stdout);    fflush(stderr);#endif /* USE_SLANG */#ifdef _WINDOWS    clear();#endif    LYCursesON = TRUE;    CTRACE(tfp, "start_curses: done.\n");}