瀏覽代碼

Implement conio.h's getche() and move cursor to top right corner after

a call to clrscr().
tags/v0.99.beta17
Sam Hocevar sam 16 年之前
父節點
當前提交
9ee841240f
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. +6
    -4
      caca/caca_conio.c

+ 6
- 4
caca/caca_conio.c 查看文件

@@ -65,6 +65,7 @@ void caca_conio_clrscr(void)
conio_init(); conio_init();


caca_clear_canvas(cv); caca_clear_canvas(cv);
caca_gotoxy(cv, 0, 0);


conio_refresh(); conio_refresh();
} }
@@ -152,11 +153,12 @@ int caca_conio_getch(void)
/** \brief DOS conio.h getche() equivalent */ /** \brief DOS conio.h getche() equivalent */
int caca_conio_getche(void) int caca_conio_getche(void)
{ {
conio_init();

/* TODO: implement this function */
/* conio_init() is called here. */
int tmp = caca_conio_getch();
/* conio_refresh() is called here. */
caca_conio_printf("%c", tmp);


return 0;
return tmp;
} }


/** \brief DOS conio.h getpass() equivalent */ /** \brief DOS conio.h getpass() equivalent */


Loading…
取消
儲存