better messages

This commit is contained in:
tth 2021-08-30 12:23:49 +02:00
parent f5b9cf17dc
commit 7e051e3caa

View File

@ -5,8 +5,10 @@ int main(int argc, char *argv[])
{ {
int key; int key;
if (2 != argc) exit(1); if (2 != argc) {
fputs("need an argument\n", stderr);
exit(1);
}
initscr(); /* first initialization */ initscr(); /* first initialization */
cbreak(); /* no line buffering */ cbreak(); /* no line buffering */
noecho(); /* be silent on input */ noecho(); /* be silent on input */
@ -14,11 +16,9 @@ keypad(stdscr, TRUE); /* acces touches curseur */
mvaddstr(10, 3, argv[1]); mvaddstr(10, 3, argv[1]);
refresh(); refresh();
key = getch(); key = getch();
endwin(); endwin();
printf("code touche %d\n", key); printf("code touche %d 0x%X\n", key, key);
return 0; return 0;
} }