Input and Output

LibGGI provides means to do basic graphical input and output. If you need more complex things, use the event interface described in the previous section and the text-rendering functions of LibGGI-2D.

int ggiKbhit(ggi_visual_t vis);
Check if a key has been hit on the keyboard. This does not consume the key. It is basically for easy porting of old DOS applications.

Don't just do while( ! ggiKbhit(vis) ); . On a Multitasking-OS you are wasting ressources which would be available to other processes. If you want to wait for a key, use the ggiGetc() call.

int ggiGetc(ggi_visual_t vis);
Get a character from the keyboard. The returncode will be a 16 bit Unicode character. As a simple heuristic, you may use & 0xff to convert it to iso-latin-1 for quickly porting an old application.

Please do that right later using the K_* symbols.

int ggiPutc(ggi_visual_t vis,int x,int y,char c);
Put a single character on a graphical visual. This is only a very simple routine using a fixed-width 8x8 font. See the libGGI-2D manual for enhanced font rendering support.
int ggiPuts(ggi_visual_t vis,int x,int y,const char *str);
Put multiple characters at once. No special handling is applied to control characters like CR or LF. You will see the associated glyph being displayed, so do this yourself if you need.

Don't use Putc for multiple-characters, as Puts might be able to optimize the optput of muliple chars at once.