Karma::Output - a highlevelish io interface to the perl Curses extension
 use Karma::Output;
  { ... }
 init_curse;
Ahh, there isn't really a way to describe the code that lies within. At least, not in a form suitable for inclusion in the man page ;-) Suffice to say that, Karma::Output is a necessary evil for my work.
The use of init_curse() is needed so that you still get a chance execute some code in normal mode before the curses screens are initialized; you must call this fucntion before making any curses calls. init_curse() will load the necessary modules for you, as well as initializing the screen and console. After which point, you will be able to make use of several extended curses functions.
getinput()$string = getinput(y, x, window_width, buffer_width, $prompt, Option => Value ... );
This routine will begin taking input at the specified location on the screen, and will happily do so near the edge of that screen (causing a brain melting, line wrapping, chaos). it supports the following movements and actions:
The options that may be supplied in the function call are as follows:
printc()One thing that I've never understood about curses is the lack of an easy method for changing the graphics rendition.
I mean, at a look at what the tput utility does. Such a wonderful tool for the shell script'er, even it falls behind in features; an example being the fact that you can only specify one attribute at a time, with no text in between.
Basically, what I needed for karma was a terminal independent terminal emulation. So that instead of tediously makeing calls to attrset and addstr, I could simply do something like:
printc '^70^Bthis is white text on a black background.';
Which is exactly what I've done. In the future I hope to add
a full set of attributes, comparable to the tput listing.
They would be expressed in the form ^{attr}, embedded in
strings passed to the printc() function.
You can even use printc() like a printf with a syntax like this:
printc sprintf 'format', list;
Also, keep in mind that the function takes a variable list of arguments in the same fassion as all of the other Curses routines.
You might want to visit the manpage for Karma::Output's father library Curses, and even then his father ncurses.