General Terminal

GtKeyChar

Convert an input key code to UTF-8

Syntax

Signature
const char *GtKeyChar( int key );

Arguments

key is an input key code, such as a value returned by Inkey().

Return value

The UTF-8 character, or an empty string for a key without a character.

Description

Accepts printable ASCII and values carrying a Unicode character. The next call replaces the returned string.

Example

gtkeychar.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   puts( GtKeyChar( 'A' ) );

   return 0;
}

Output

A

See also