#include <stdio.h>
#include <termio.h>

int getch(void)
{
int ch;
struct termios buf, save;

tcgetattr(0, &save);
buf = save;

buf.c_lflag &= ~(ICANON|ECHO);
buf.c_cc[VMIN] = 1;
buf.c_cc[VTIME] = 0;

tcsetattr(0, TCSAFLUSH, &buf);
ch = getchar();
tcsetattr(0, TCSAFLUSH, &save);
return ch;
}

크리에이티브 커먼즈 라이센스
Creative Commons License
2009/04/16 11:41 2009/04/16 11:41

이 글에는 트랙백을 보낼 수 없습니다

Leave a Comment
[로그인][오픈아이디란?]
1 ... 22 23 24 25 26 27 28 29 30 ... 78