Ok. I thought I might be missing something and should mention to the
group for support. Thanks
There are several problems in this area:
- Reading characters without waiting for RETURN
- Reading characters without echoing them on the screen
- Determine if a key has been pressed
- Write to a specific screen position
- Positioning the cursor
Years ago I wrote a portable library to address this
problems. This library interfaces to different functions
on Windows and Linux. I even found some errors in curses,
so I based this library on terminfo instead of curses.
Long ago I stopped supporting this library in its form
as simple C library. Instead I improved it and now it is
part of the Seed7 runtime library. As such it is tailored
towards Seed7 (e.g.: It uses Seed7 strings instead of C
strings). With this library Seed7 supports all the
keyboard and screen related things in a portable way.
A program which uses the keypressed function is here:
http://seed7.sourceforge.net/examples/txtclock.htm
Every experienced programmer is able to convert my
keyboard/screen library, so that it is usable from C.
But for you this is probably byond your capabilities.
I have seen you struggle with many simple things in C.
I guess that C is not the right programming language for
you. My advice is: Use a different programming language.
I don't intend to convert you to Seed7. You can choose
whatever you want, but you really should move away from
C to a "higher level" language.
Greetings Thomas Mertes
--
Seed7 Homepage:
http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.