-------- Original Message -------- Asunto: Re: Compile GRX with Mingw Fecha: Sat, 21 Apr 2001 00:20:42 +0200 De: Mariano Alvarez Fernandez malfer@teleline.es A: Waldemar Schultz schultzma@mathematik.tu-muenchen.de Referencias: 3AD0ECA1.41D6E0E0@teleline.es 3AD159B8.8DCB55E2@ma.tum.de 3AD1F992.66ECF8B2@teleline.es 3AD2D051.848190B0@ma.tum.de 3AD34CA2.40EB6285@teleline.es 3AD4177E.7CB788BA@ma.tum.de 3AD492B5.F7F1DF08@teleline.es 3ADEF8FE.9946EE8D@ma.tum.de
Waldemar Schultz escribió:
can anyone please tell me why getch() doesn't work in a console window ? and what about thet kbhit(9 flushing in modetest.c ?
The win32 port provides GrKeyRead, GrKeyStat, kbhit, getkey and getch (the last three only for compatibility with old programs, without prototipe they in grx20.h). All functions use the GUI input. For read/write to console you need to read/write to stdin/stdout. See src/mouse/w32keys.c
Mariano Alvarez Fernandez schrieb:
The win32 port provides GrKeyRead, GrKeyStat, kbhit, getkey and getch (the last three only for compatibility with old programs, without prototipe they in grx20.h). All functions use the GUI input. For read/write to console you need to read/write to stdin/stdout. See src/mouse/w32keys.c
With a little experimenting I found the following summary: IMHO this should be completed and go to the docs.
"all C-output function write to the Console" to printf( -> Console window fprintf(stdout, -> Console window puts( -> Console window
getch( <- Graphics window kbhit( <- Graphics window gets( <- Console window fgetc(stdin <- Console window "all other C-input functions refer to the Console"
As far as I see there is no equivalent function like kbhit(stdin) to obtain the console stream satus.