---
name: "ggiGetc"
section: "3ggi"
platform: "linux"
package: "libggi2-dev"
version: "1:2.0.1-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/ggiGetc/3ggi"
---

# ggiGetc(3ggi)

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***);** .SH "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 \[XRef to GII-KEYSYM\].

## SEE ALSO

[**ggiEventPoll**(3)](/ggiEventPoll/3.md)
