Fixed up support for screen refresh using ^L - in case something
sends gunk to the screen.
This commit is contained in:
@@ -37,6 +37,7 @@ lcd_logical_driver *curses_drv;
|
|||||||
// #define PAD ACS_BLOCK
|
// #define PAD ACS_BLOCK
|
||||||
|
|
||||||
int ELLIPSIS = 7;
|
int ELLIPSIS = 7;
|
||||||
|
void curses_drv_restore_screen (void);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////// For Curses Terminal Output ////////////////////////
|
////////////////////// For Curses Terminal Output ////////////////////////
|
||||||
@@ -385,6 +386,8 @@ curses_drv_string (int x, int y, char *string)
|
|||||||
void
|
void
|
||||||
curses_drv_chr (int x, int y, char c)
|
curses_drv_chr (int x, int y, char c)
|
||||||
{
|
{
|
||||||
|
int ch;
|
||||||
|
|
||||||
ValidX(x);
|
ValidX(x);
|
||||||
ValidY(y);
|
ValidY(y);
|
||||||
|
|
||||||
@@ -399,6 +402,12 @@ curses_drv_chr (int x, int y, char c)
|
|||||||
// normal character...
|
// normal character...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((ch = getch ()) != ERR)
|
||||||
|
if (ch == 0x0C) {
|
||||||
|
curses_drv_restore_screen();
|
||||||
|
ungetch(ch);
|
||||||
|
}
|
||||||
|
|
||||||
mvwaddch (lcd_win, y, x, c);
|
mvwaddch (lcd_win, y, x, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,6 +536,14 @@ curses_drv_flush_box (int lft, int top, int rgt, int bot)
|
|||||||
void
|
void
|
||||||
curses_drv_draw_frame (char *dat)
|
curses_drv_draw_frame (char *dat)
|
||||||
{
|
{
|
||||||
|
int c;
|
||||||
|
|
||||||
|
if ((c = getch ()) != ERR)
|
||||||
|
if (c == 0x0C) {
|
||||||
|
curses_drv_restore_screen();
|
||||||
|
ungetch (c);
|
||||||
|
}
|
||||||
|
|
||||||
curses_drv_wborder (lcd_win);
|
curses_drv_wborder (lcd_win);
|
||||||
wrefresh (lcd_win);
|
wrefresh (lcd_win);
|
||||||
}
|
}
|
||||||
@@ -540,21 +557,34 @@ curses_drv_getkey ()
|
|||||||
|
|
||||||
switch(i) {
|
switch(i) {
|
||||||
case 0x0C:
|
case 0x0C:
|
||||||
redrawwin(lcd_win);
|
curses_drv_restore_screen();
|
||||||
wrefresh(lcd_win);
|
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
return 'D';
|
return 'D';
|
||||||
|
break;
|
||||||
case KEY_UP:
|
case KEY_UP:
|
||||||
return 'B';
|
return 'B';
|
||||||
|
break;
|
||||||
case KEY_DOWN:
|
case KEY_DOWN:
|
||||||
return 'C';
|
return 'C';
|
||||||
|
break;
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT:
|
||||||
return 'A';
|
return 'A';
|
||||||
|
break;
|
||||||
case ERR:
|
case ERR:
|
||||||
return 0;
|
return 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return i;
|
return i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
curses_drv_restore_screen () {
|
||||||
|
erase();
|
||||||
|
refresh();
|
||||||
|
redrawwin(lcd_win);
|
||||||
|
wrefresh(lcd_win);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user