1define_key(3X) define_key(3X)
2
3
4
6 define_key - define a keycode
7
9 #include <curses.h>
10
11 int define_key(const char *definition, int keycode);
12
14 This is an extension to the curses library. It permits an application
15 to define keycodes with their corresponding control strings, so that
16 the ncurses library will interpret them just as it would the predefined
17 codes in the terminfo database.
18
19 If the given string is null, any existing definition for the keycode is
20 removed. Similarly, if the given keycode is negative or zero, any
21 existing string for the given definition is removed.
22
24 The keycode must be greater than zero, and the string non-null, other‐
25 wise ERR is returned. ERR may also be returned if there is insuffi‐
26 cient memory to allocate the data to store the definition. If no error
27 is detected, OK is returned.
28
30 These routines are specific to ncurses. They were not supported on
31 Version 7, BSD or System V implementations. It is recommended that any
32 code depending on them be conditioned using NCURSES_VERSION.
33
35 keyok(3X), key_defined(3X).
36
38 Thomas Dickey.
39
40
41
42 define_key(3X)