[ prev :: next :: up ] libggi-current (3)

Convenience functions for simplistic keyboard input

Name

ggiGetc, ggiKbhit : Convenience functions for simplistic keyboard input

Synopsis

#include <ggi/ggi.h>

int ggiGetc(ggi_visual_t vis);

int ggiKbhit(ggi_visual_t vis);

Description

ggiGetc gets a character from the keyboard, and blocks if there is no key immediately available.

ggiKbhit checks if a key has been hit on the keyboard. This does not consume the key. It is used for easy porting of old DOS applications.

Important

Do not poll like this: do while( ! ggiKbhit(vis) ); On a multitasking OS you would be wasting a lot of resources which could be available to other processes. If you want to wait for a key, use the ggiGetc call.

Return value

ggiKbhit returns 0 if no key has been received yet, otherwise there is a key to be consumed.

ggiGetc returns a Unicode character in canonical form.

For a fuller definition of characters, see :man:`gii_key_event(3)`.

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 2158); backlink

Unknown interpreted text role "man".

See Also

:man:`ggiEventPoll(3)`

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 2164); backlink

Unknown interpreted text role "man".
 
[ prev :: next :: up ] libggi-current (3)
2008/05/04 23:15:04