Added nf.c
This commit is contained in:
parent
4e1e7d9940
commit
561f440bce
28
nf.c
Normal file
28
nf.c
Normal file
@ -0,0 +1,28 @@
|
||||
#include <ncurses.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void* fool(void* args){
|
||||
sleep(2);
|
||||
ungetch('x');
|
||||
ungetch('c');
|
||||
printw(" OK");
|
||||
refresh();
|
||||
}
|
||||
|
||||
int main() {
|
||||
initscr();
|
||||
cbreak(); // Set cbreak mode on
|
||||
|
||||
printw("Press any key to continue...");
|
||||
refresh();
|
||||
|
||||
pthread_t th;
|
||||
pthread_create(&th, NULL, fool, NULL);
|
||||
|
||||
getch();
|
||||
pthread_join(th, NULL);
|
||||
|
||||
endwin();
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user