B
Bill Cunningham
tm said: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.
I appreciate your concern and interest. I have not ruled this idea out
either. I have never heard of seed7 until you mentioned it. I have looked at
java too though not too seriously. I have come to understand the std
functions to a good degree but the fundamental basics of C still escape me.
I don't know if I am not looking at good code and still reading very basic
books or what. I also have a lot of trouble remembering what I've just read
so that handicaps me. Keith has pointed me to a FAQ question and that
question does answer somewhat my problem but I do know how to remove a
character just typed by using ungetchar().
Also my life doesn't revolve around C or programming so it takes me a
little more time to do things. Try taking 4mg of klonpin a day too and you
might have trouble staying in conversations.
Bill