2020-09-27 17:29:13 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <ncurses.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
int key;
|
|
|
|
|
2021-08-30 12:23:49 +02:00
|
|
|
if (2 != argc) {
|
|
|
|
fputs("need an argument\n", stderr);
|
|
|
|
exit(1);
|
|
|
|
}
|
2020-09-27 17:29:13 +02:00
|
|
|
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();
|
2021-08-30 12:23:49 +02:00
|
|
|
printf("code touche %d 0x%X\n", key, key);
|
2020-09-27 17:29:13 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|