Example #1
0
 int con_init()
 {
   initscr();
   start_color();
   qiflush();
   cbreak();
   if ( !getenv("UNICON_NO_RAW") )
     {
     /* To allow curses app to handle properly ctrl+z, ctrl+c, etc.
        I should not call raw() here, anyway it is known that this
        will cause misinterpretation of some keys (arrows) after
        resuming (SUSP -- ctrl+z)...
        So, unless UNICON_NO_RAW exported and set to any value raw()
        is called as usual.
     */
     raw();
     }
   noecho();
   nonl(); // `return' translation off
   if (!has_colors())
      fprintf(stderr,"Attention: A color terminal may be required to run this application !\n");
   conio_scr=newwin(0,0,0,0);
   keypad(conio_scr,TRUE); // allow function keys (keypad)
   meta(conio_scr,TRUE); // switch to 8 bit terminal return values
   // intrflush(conio_scr,FALSE); //
   idlok(conio_scr,TRUE);      // hardware line ins/del (required?)
   idcok(conio_scr,TRUE);      // hardware char ins/del (required?)
   scrollok(conio_scr,TRUE);   // scroll screen if required (cursor at bottom)
   /* Color initialization */
   for ( __bg=0; __bg<8; __bg++ )
      for ( __fg=0; __fg<8; __fg++ )
         init_pair( CON_PAIR(__fg,__bg), colortab(__fg), colortab(__bg));
   con_ta(7);
   return 0;
 }
Example #2
0
// lnc.qiflush(on: boolean)
static int lnc_qiflush(lua_State *L)
{
	luaL_checktype(L, -1, LUA_TBOOLEAN);
	int on = lua_toboolean(L, -1);
	if (on) {
		qiflush();
	} else {
		noqiflush();
	}
	return 0;
}