getchar()
Ed Drury
edrury at 3cpu.UUCP
Sun Mar 10 10:01:36 AEST 1991
In article <5CTOV6E at methan.chemie.fu-berlin.de> kirste at methan.chemie.fu-berlin.de (Burkhard Kirste) writes:
>storm at cs.mcgill.ca (Marc WANDSCHNEIDER) writes:
>
>>> Your problem is that getchar() does not recognize ANY input until
>>>you hit Enter.
>>
[ "yes, but..." stuff deleted ]
oh yes, much more complicated, you have to use #include <curses.h>
rather than #include <conio.h> -- but the question as I understand
it was how to impliment "hot" keys under DOS using C which is not
portably done under DOS by reading scan codes -- but is portably
done by using pccurses or a series of #define KEY_UP etc ...
union k {
char ch[2];
unsigned i;
} key;
...
if(!key.ch[0]) { /* it's a 'hot' one */
switch(key.ch[1]){
...
}
Ed
More information about the Comp.lang.c
mailing list