3 * \brief Header: mouse managing
5 * Events received by clients of this library have their coordinates 0 based
12 /* GPM mouse support include file */
14 #endif /* !HAVE_LIBGPM */
17 /*** typedefs(not structures) and defined constants **********************************************/
20 /* Equivalent definitions for non-GPM mouse support */
21 /* These lines are modified version from the lines appearing in the */
22 /* gpm.h include file of the Linux General Purpose Mouse server */
24 #define GPM_B_LEFT (1 << 2)
25 #define GPM_B_MIDDLE (1 << 1)
26 #define GPM_B_RIGHT (1 << 0)
28 #define GPM_BARE_EVENTS(ev) ((ev)&0xF)
29 #endif /* !HAVE_LIBGPM */
31 /* Mouse wheel events */
33 #define GPM_B_DOWN (1 << 5)
37 #define GPM_B_UP (1 << 4)
40 /*** enums ***************************************************************************************/
43 /* Xterm mouse support supports only GPM_DOWN and GPM_UP */
44 /* If you use others make sure your code also works without them */
48 GPM_DRAG
= 2, /* exactly one in four is active at a time */
53 GPM_SINGLE
= 16, /* at most one in three is set */
57 GPM_MFLAG
= 128, /* motion during click? */
58 GPM_HARD
= 256 /* if set in the defaultMask, force an already
59 used event to pass over to another handler */
61 #endif /* !HAVE_LIBGPM */
63 /* Constants returned from the mouse callback */
71 /* Type of mouse support */
74 MOUSE_NONE
, /* Not detected yet */
75 MOUSE_DISABLED
, /* Explicitly disabled by -d */
76 MOUSE_GPM
, /* Support using GPM on Linux */
77 MOUSE_XTERM
, /* Support using xterm-style mouse reporting */
78 MOUSE_XTERM_NORMAL_TRACKING
= MOUSE_XTERM
,
79 MOUSE_XTERM_BUTTON_EVENT_TRACKING
82 /*** structures declarations (and typedefs of structures)*****************************************/
85 typedef struct Gpm_Event
90 #endif /* !HAVE_LIBGPM */
92 /*** global variables defined in .c file *********************************************************/
94 /* Type of the currently used mouse */
95 extern Mouse_Type use_mouse_p
;
97 /* To be used when gpm_fd were initially >= 0 */
100 /* String indicating that a mouse event has occurred, usually "\E[M" */
101 extern const char *xmouse_seq
;
103 /* String indicating that an SGR extended mouse event has occurred, namely "\E[<" */
104 extern const char *xmouse_extended_seq
;
106 /*** declarations of public functions ************************************************************/
108 /* General (i.e. both for xterm and gpm) mouse support definitions */
110 void init_mouse (void);
111 void enable_mouse (void);
112 void disable_mouse (void);
114 void show_mouse_pointer (int x
, int y
);
116 /*** inline functions ****************************************************************************/
117 #endif /* MC_MOUSE_H */