On (07 May 97) Cameron Clark wrote to Jerry Coffin...
CC> I tried writing my own conio.h on a UNIX system (solaris?) and a
CC> few of the macros like addstr() where not available in the
CC> curses.h on this rag/tag system.
CC> I might have to just dig up some vt100 codes to move cursor and
CC> change attributes - I hate the curses.h library and often find
CC> myself having to hangup because keyboard input has been taken
CC> control of an not released by my program.
CC> The only things I need to change are gotoxy(), cputs, and some
CC> kind of mimic for textcolor textbackgroung for hilights, oh yeah
CC> and the biggy getch() - I need just a key at a time and function
CC> keys to return a null first and then a key code.
There's a getch() replacement in Snippets that should be portable to
Solaris or just about any other POSIX system. It'll read one key press
at a time, though it won't convert function keys to create input like
DOS function keys. I'd consider rewriting things a bit to use a data
file specifying the string created by each function key, and simply
matching the actual input with a string to find the correct key.
You might also want to take a look at the termio and/or termios
libraries. (termios is the POSIX one...) which provide reasonably
terminal independent access to things like highlighting and cursor
positioning. Given the relatively low-level calls you're using, termios
is likely closer to what you want than curses.
Later,
Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)
|