1

I have CLI implementation for my VisualWorks application. There is "IOAccessor defaultClass stdin" and I want to read one character without waiting for user enter press. It is possible?

in C language there is function like getCh ...

borovsky
  • 873
  • 1
  • 9
  • 15

1 Answers1

3

This is not a problem of the language: also the C-language getchar() will have to wait. It is a matter of the underlying Operating System's tty-code. On UNIX (eg. Linux), you'd have to change the tty-characteristics to unbuffered, using an stty (old-style) or ioctl call. Under other OSs, similar system calls do similar things.

blabla999
  • 3,130
  • 22
  • 24