read a single key witout return

From: Jean-Pol Guillement <Jean-Pol.Guillement_at_math.univ-nantes.fr>
Date: Mon, 21 Sep 1998 17:18:58 +0200 (MET DST)

Hello,

In C-programming under D-Unix, is there a better way than the
following to get a single character from the keyboard
without waiting for Return ?
perhaps with iotcl() or tcsetattr() ?

int readkey() {
int c;

system("stty raw -echo");
c = getchar();
system("stty -raw echo");
return(c);
}

Thanks in advance,

Jean-Pol.Guillement_at_math.univ-nantes.fr
Received on Mon Sep 21 1998 - 15:19:57 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT