mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-22 10:29:31 +00:00
replace getchar() by console_getchar()
This commit is contained in:
parent
8d02f4dac4
commit
c00938b25e
@ -27,6 +27,8 @@ extern void console_video_inverse(void);
|
|||||||
extern void console_video_normal(void);
|
extern void console_video_normal(void);
|
||||||
extern void console_select_charset(char c);
|
extern void console_select_charset(char c);
|
||||||
extern void console_cursor_off();
|
extern void console_cursor_off();
|
||||||
|
extern int console_getchar(void);
|
||||||
|
extern int console_keypressed(int timeout);
|
||||||
|
|
||||||
extern void emile_window(emile_window_t *win);
|
extern void emile_window(emile_window_t *win);
|
||||||
extern emile_progressbar_t* emile_progressbar_create(emile_window_t *win, int max);
|
extern emile_progressbar_t* emile_progressbar_create(emile_window_t *win, int max);
|
||||||
|
@ -47,14 +47,17 @@ int emile_scrolllist(emile_window_t *win, emile_list_t *list)
|
|||||||
emile_window(win);
|
emile_window(win);
|
||||||
display_list(win, list, base);
|
display_list(win, list, base);
|
||||||
|
|
||||||
while((c = getchar()) != -1)
|
while(1)
|
||||||
{
|
{
|
||||||
|
c = console_getchar();
|
||||||
|
if (c == -1)
|
||||||
|
break;
|
||||||
if (c == '\033')
|
if (c == '\033')
|
||||||
{
|
{
|
||||||
c = getchar();
|
c = console_getchar();
|
||||||
if (c != '[')
|
if (c != '[')
|
||||||
continue;
|
continue;
|
||||||
c = getchar();
|
c = console_getchar();
|
||||||
if ( (c == 'B') && (list->current < list->nb - 1) )
|
if ( (c == 'B') && (list->current < list->nb - 1) )
|
||||||
{
|
{
|
||||||
list->current++;
|
list->current++;
|
||||||
@ -72,6 +75,8 @@ int emile_scrolllist(emile_window_t *win, emile_list_t *list)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
console_keypressed(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user