blob: bbfa980bda05439b243a51312f4e0820a5aa3044 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <stdio.h>
#include <slang.h>
int main ()
{
int abort_char = 7; /* For MSDOS, use 34 as scan code */
unsigned int ch;
if (-1 == SLang_init_tty (abort_char, 0, 1))
{
fprintf (stderr, "Unable to initialize the terminal.\n");
exit (-1);
}
SLang_set_abort_signal (NULL);
fflush (stdout);
ch = SLang_getkey ();
printf("<< %c >> %d ",ch, SLang_Error);
SLang_reset_tty ();
return 0;
}
|