1TERMKEY_KEYNAME2SYM(3) Library Functions Manual TERMKEY_KEYNAME2SYM(3)
2
3
4
6 termkey_keyname2sym - look up a symbolic key value for a string name
7
9 #include <termkey.h>
10
11 TermKeySym termkey_keyname2sym(TermKey *tk, const char *keyname);
12
13 Link with -ltermkey.
14
16 termkey_keyname2sym() looks up the symbolic key value represented by
17 the given string name. This is a case-sensitive comparison. If the
18 given name is not found, TERMKEY_SYM_UNKNOWN is returned instead. This
19 function is the inverse of termkey_get_keyname(3), and is a more spe‐
20 cific form of termkey_lookup_keyname(3) which only recognises names as
21 complete strings.
22
23 Because the key names are stored in an array indexed by the symbol num‐
24 ber, this function has to perform a linear search of the names. Use of
25 this function should be restricted to converting key names into sym‐
26 bolic values during a program's initialisation, so that efficient com‐
27 parisons can be done while it is running.
28
30 termkey_keyname2sym() returns a symbolic key constant, or
31 TERMKEY_SYM_UNKNOWN.
32
34 termkey_get_keyname(3), termkey_lookup_keyname(3), termkey_strpkey(3),
35 termkey(7)
36
37
38
39 TERMKEY_KEYNAME2SYM(3)