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

NAME

6       termkey_interpret_mouse - interpret opaque mouse event data
7

SYNOPSIS

9       #include <termkey.h>
10
11       TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key,
12           TermKeyMouseEvent *ev, int *button, int *line, int *col);
13
14       Link with -ltermkey.
15

DESCRIPTION

17       termkey_interpret_mouse()  fills  in  variables  in the passed pointers
18       according to the mouse event found in  key.  It  should  be  called  if
19       termkey_getkey(3) or similar have returned a key event with the type of
20       TERMKEY_TYPE_MOUSE.
21
22       Any pointer may instead be given as NULL to not return that value.
23
24       The ev variable will take one of the following values:
25
26       TERMKEY_MOUSE_UNKNOWN
27              an unknown mouse event.
28
29       TERMKEY_MOUSE_PRESS
30              a mouse button was pressed; button will contain its number.
31
32       TERMKEY_MOUSE_DRAG
33              the mouse was moved while holding a button; button will  contain
34              its number.
35
36       TERMKEY_MOUSE_RELEASE
37              a  mouse  button  was  released, or the mouse was moved while no
38              button was pressed. If known, button will contain the number  of
39              the  button  released.  Not all terminals can report this, so it
40              may be 0 instead.
41
42       The line and col variables will be filled in with the  mouse  position,
43       indexed  from  1.  Note  that due to the limited number of bytes in the
44       TermKeyKey structure, the line and column numbers are limited  to  2047
45       and 4095 respectively.
46

RETURN VALUE

48       If  passed  a  key  event of the type TERMKEY_TYPE_MOUSE, this function
49       will return TERMKEY_RES_KEY and will affect the variables whose  point‐
50       ers were passed in, as described above.
51
52       For  other event types it will return TERMKEY_RES_NONE, and its effects
53       on any variables whose pointers were passed in, are undefined.
54

SEE ALSO

56       termkey_waitkey(3), termkey_getkey(3), termkey(7)
57
58
59
60                                                    TERMKEY_INTERPRET_MOUSE(3)
Impressum