1TERMKEY_INTERPRET_CSI(3)   Library Functions Manual   TERMKEY_INTERPRET_CSI(3)
2
3
4

NAME

6       termkey_interpret_csi - interpret unrecognised CSI sequence
7

SYNOPSIS

9       #include <termkey.h>
10
11       TermKeyResult termkey_interpret_csi(TermKey *tk, const TermKeyKey *key,
12           long *args[], size_t *nargs, unsigned long *cmd);
13
14       Link with -ltermkey.
15

DESCRIPTION

17       termkey_interpret_csi()  fills  in  variables  in  the  passed pointers
18       according to the unrecognised CSI  sequence  event  found  in  key.  It
19       should  be  called  if termkey_getkey(3) or similar have returned a key
20       event with the type of TERMKEY_TYPE_UNKNOWN_CSI. Note that it is impor‐
21       tant  to  call  this  function  as  soon  as possible after obtaining a
22       TERMKEY_TYPE_CSI    key    event;    specifically,    before    calling
23       termkey_getkey()  or termkey_waitkey() again, as a subsequent call will
24       overwrite the buffer space currently containing this sequence.
25
26       The args array will be filled with the numerical arguments of  the  CSI
27       sequence.  The  number  of  elements  available in this array should be
28       given as the initial value of the value pointed to by nargs, which will
29       be  adjusted  to  give  the number of arguments actually found when the
30       function returns. The cmd variable will contain the CSI command  value.
31       If  a leading byte was found (such as '?') then it will be bitwise-ored
32       with the command value, shifted up by 8 bits. If an  intermediate  byte
33       was  found  (such as '$') then it will be bitwise-ored with the command
34       value, shifted up by 16 bits.
35
36           *cmd = command | (initial << 8) | (intermediate << 16);
37

RETURN VALUE

39       If passed a key event of the type TERMKEY_TYPE_UNKNOWN_CSI, this  func‐
40       tion  will  return  TERMKEY_RES_KEY and will affect the variables whose
41       pointers were passed in, as described above.
42
43       For other event types it will return TERMKEY_RES_NONE, and its  effects
44       on any variables whose pointers were passed in, are undefined.
45

SEE ALSO

47       termkey_waitkey(3), termkey_getkey(3), termkey(7)
48
49
50
51                                                      TERMKEY_INTERPRET_CSI(3)
Impressum