Convenience functions for simplistic keyboard input

Name

giiGetc, giiKbhit : Convenience functions for simplistic keyboard input

Synopsis

#include <ggi/gii.h>

int giiGetc(gii_input inp);

int giiKbhit(gii_input inp);

Description

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

giiKbhit 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( ! giiKbhit(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 giiGetc call.

Return value

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

giiGetc returns a Unicode character in canonical form.

For a more detailed definition of characters, see gii_key_event(3).

See Also