Une collection de notes diverses sur des trucs et astuces pour faire des choses avec un ordinateur...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
TetaTricks/code/ex_curses.c

26 lines
457 B

#include <stdio.h>
#include <stdlib.h>
#include <ncurses.h>
int main(int argc, char *argv[])
{
int key;
if (2 != argc) {
fputs("need an argument\n", stderr);
exit(1);
}
initscr(); /* first initialization */
cbreak(); /* no line buffering */
noecho(); /* be silent on input */
keypad(stdscr, TRUE); /* acces touches curseur */
mvaddstr(10, 3, argv[1]);
refresh();
key = getch();
endwin();
printf("code touche %d 0x%X\n", key, key);
return 0;
}