Added nf.c

This commit is contained in:
anon 2024-03-10 15:57:36 +01:00
parent 4e1e7d9940
commit 561f440bce

28
nf.c Normal file
View 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;
}