## Keys

Keys — Key value lookup and transformation

## Functions

#define | SAFE()
void | gnt_init_keys ()
void | gnt_keys_refine ()
const char * | gnt_key_translate ()
const char * | gnt_key_lookup ()
void | gnt_keys_add_combination ()
void | gnt_keys_del_combination ()
int | gnt_keys_find_combination ()

## Types and Values

extern char * | gnt_key_cup
extern char * | gnt_key_cdown
extern char * | gnt_key_cleft
extern char * | gnt_key_cright
#define | GNT_KEY_POPUP
#define | GNT_KEY_LEFT
#define | GNT_KEY_RIGHT
#define | GNT_KEY_UP
#define | GNT_KEY_DOWN
#define | GNT_KEY_CTRL_UP
#define | GNT_KEY_CTRL_DOWN
#define | GNT_KEY_CTRL_RIGHT
#define | GNT_KEY_CTRL_LEFT
#define | GNT_KEY_PGUP
#define | GNT_KEY_PGDOWN
#define | GNT_KEY_HOME
#define | GNT_KEY_END
#define | GNT_KEY_ENTER
#define | GNT_KEY_BACKSPACE
#define | GNT_KEY_DEL
#define | GNT_KEY_INS
#define | GNT_KEY_BACK_TAB
#define | GNT_KEY_CTRL_A
#define | GNT_KEY_CTRL_B
#define | GNT_KEY_CTRL_D
#define | GNT_KEY_CTRL_E
#define | GNT_KEY_CTRL_F
#define | GNT_KEY_CTRL_G
#define | GNT_KEY_CTRL_H
#define | GNT_KEY_CTRL_I
#define | GNT_KEY_CTRL_J
#define | GNT_KEY_CTRL_K
#define | GNT_KEY_CTRL_L
#define | GNT_KEY_CTRL_M
#define | GNT_KEY_CTRL_N
#define | GNT_KEY_CTRL_O
#define | GNT_KEY_CTRL_P
#define | GNT_KEY_CTRL_R
#define | GNT_KEY_CTRL_T
#define | GNT_KEY_CTRL_U
#define | GNT_KEY_CTRL_V
#define | GNT_KEY_CTRL_W
#define | GNT_KEY_CTRL_X
#define | GNT_KEY_CTRL_Y
#define | GNT_KEY_F1
#define | GNT_KEY_F2
#define | GNT_KEY_F3
#define | GNT_KEY_F4
#define | GNT_KEY_F5
#define | GNT_KEY_F6
#define | GNT_KEY_F7
#define | GNT_KEY_F8
#define | GNT_KEY_F9
#define | GNT_KEY_F10
#define | GNT_KEY_F11
#define | GNT_KEY_F12

## Description

## Functions

### SAFE()

    #define             SAFE(x)

### gnt_init_keys ()

    void
    gnt_init_keys (void);

Initialize the keys.

### gnt_keys_refine ()

    void
    gnt_keys_refine (char *text);

Refine input text. This usually looks at what the terminal claims it is, and tries to change the text to work around some oft-broken terminfo entries.

#### Parameters

text | The input text to refine. |

### gnt_key_translate ()

    const char *
    gnt_key_translate (const char *name);

Translate a user-readable representation of an input to a machine-readable representation.

#### Parameters

name | The user-readable representation of an input (eg.: c-t) |

#### Returns

A machine-readable representation of the input.

### gnt_key_lookup ()

    const char *
    gnt_key_lookup (const char *key);

Translate a machine-readable representation of an input to a user-readable representation.

#### Parameters

key | The machine-readable representation of an input. |

#### Returns

A user-readable representation of the input (eg.: c-t).

### gnt_keys_add_combination ()

    void
    gnt_keys_add_combination (const char *key);

Add a key combination to the internal key-tree.

#### Parameters

key | The key to add |

### gnt_keys_del_combination ()

    void
    gnt_keys_del_combination (const char *key);

Remove a key combination from the internal key-tree.

#### Parameters

key | The key to remove. |

### gnt_keys_find_combination ()

    int
    gnt_keys_find_combination (const char *key);

Find a combination from the given string.

#### Parameters

key | The input string. |

#### Returns

The number of bytes in the combination that starts at the beginning of key (can be 0).

## Types and Values

### gnt_key_cup

    extern char *gnt_key_cup;

### gnt_key_cdown

    extern char *gnt_key_cdown;

### gnt_key_cleft

    extern char *gnt_key_cleft;

### gnt_key_cright

    extern char *gnt_key_cright;

### GNT_KEY_POPUP

    #define             GNT_KEY_POPUP

### GNT_KEY_LEFT

    #define             GNT_KEY_LEFT

### GNT_KEY_RIGHT

    #define             GNT_KEY_RIGHT

### GNT_KEY_UP

    #define             GNT_KEY_UP

### GNT_KEY_DOWN

    #define             GNT_KEY_DOWN

### GNT_KEY_CTRL_UP

    #define             GNT_KEY_CTRL_UP

### GNT_KEY_CTRL_DOWN

    #define             GNT_KEY_CTRL_DOWN

### GNT_KEY_CTRL_RIGHT

    #define             GNT_KEY_CTRL_RIGHT

### GNT_KEY_CTRL_LEFT

    #define             GNT_KEY_CTRL_LEFT

### GNT_KEY_PGUP

    #define             GNT_KEY_PGUP

### GNT_KEY_PGDOWN

    #define             GNT_KEY_PGDOWN

### GNT_KEY_HOME

    #define             GNT_KEY_HOME

### GNT_KEY_END

    #define             GNT_KEY_END

### GNT_KEY_ENTER

    #define             GNT_KEY_ENTER

### GNT_KEY_BACKSPACE

    #define             GNT_KEY_BACKSPACE

### GNT_KEY_DEL

    #define             GNT_KEY_DEL

### GNT_KEY_INS

    #define             GNT_KEY_INS

### GNT_KEY_BACK_TAB

    #define             GNT_KEY_BACK_TAB

### GNT_KEY_CTRL_A

    #define             GNT_KEY_CTRL_A

### GNT_KEY_CTRL_B

    #define             GNT_KEY_CTRL_B

### GNT_KEY_CTRL_D

    #define             GNT_KEY_CTRL_D

### GNT_KEY_CTRL_E

    #define             GNT_KEY_CTRL_E

### GNT_KEY_CTRL_F

    #define             GNT_KEY_CTRL_F

### GNT_KEY_CTRL_G

    #define             GNT_KEY_CTRL_G

### GNT_KEY_CTRL_H

    #define             GNT_KEY_CTRL_H

### GNT_KEY_CTRL_I

    #define             GNT_KEY_CTRL_I

### GNT_KEY_CTRL_J

    #define             GNT_KEY_CTRL_J

### GNT_KEY_CTRL_K

    #define             GNT_KEY_CTRL_K

### GNT_KEY_CTRL_L

    #define             GNT_KEY_CTRL_L

### GNT_KEY_CTRL_M

    #define             GNT_KEY_CTRL_M

### GNT_KEY_CTRL_N

    #define             GNT_KEY_CTRL_N

### GNT_KEY_CTRL_O

    #define             GNT_KEY_CTRL_O

### GNT_KEY_CTRL_P

    #define             GNT_KEY_CTRL_P

### GNT_KEY_CTRL_R

    #define             GNT_KEY_CTRL_R

### GNT_KEY_CTRL_T

    #define             GNT_KEY_CTRL_T

### GNT_KEY_CTRL_U

    #define             GNT_KEY_CTRL_U

### GNT_KEY_CTRL_V

    #define             GNT_KEY_CTRL_V

### GNT_KEY_CTRL_W

    #define             GNT_KEY_CTRL_W

### GNT_KEY_CTRL_X

    #define             GNT_KEY_CTRL_X

### GNT_KEY_CTRL_Y

    #define             GNT_KEY_CTRL_Y

### GNT_KEY_F1

    #define             GNT_KEY_F1

### GNT_KEY_F2

    #define             GNT_KEY_F2

### GNT_KEY_F3

    #define             GNT_KEY_F3

### GNT_KEY_F4

    #define             GNT_KEY_F4

### GNT_KEY_F5

    #define             GNT_KEY_F5

### GNT_KEY_F6

    #define             GNT_KEY_F6

### GNT_KEY_F7

    #define             GNT_KEY_F7

### GNT_KEY_F8

    #define             GNT_KEY_F8

### GNT_KEY_F9

    #define             GNT_KEY_F9

### GNT_KEY_F10

    #define             GNT_KEY_F10

### GNT_KEY_F11

    #define             GNT_KEY_F11

### GNT_KEY_F12

    #define             GNT_KEY_F12