2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
25 * lib_tracemse.c - Tracing/Debugging routines (mouse events)
29 #define TRACE /* turn on internal defs for this module */
32 #include <curses.priv.h>
34 MODULE_ID("$Id: lib_tracemse.c,v 1.4 1996/12/21 14:24:06 tom Exp $")
36 char *_tracemouse(MEVENT const *ep)
40 (void) sprintf(buf, "id %2d at (%2d, %2d, %2d) state %4lx = {",
41 ep->id, ep->x, ep->y, ep->z, ep->bstate);
43 #define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");}
44 SHOW(BUTTON1_RELEASED, "release-1")
45 SHOW(BUTTON1_PRESSED, "press-1")
46 SHOW(BUTTON1_CLICKED, "click-1")
47 SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1")
48 SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1")
49 SHOW(BUTTON1_RESERVED_EVENT, "reserved-1")
50 SHOW(BUTTON2_RELEASED, "release-2")
51 SHOW(BUTTON2_PRESSED, "press-2")
52 SHOW(BUTTON2_CLICKED, "click-2")
53 SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2")
54 SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2")
55 SHOW(BUTTON2_RESERVED_EVENT, "reserved-2")
56 SHOW(BUTTON3_RELEASED, "release-3")
57 SHOW(BUTTON3_PRESSED, "press-3")
58 SHOW(BUTTON3_CLICKED, "click-3")
59 SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3")
60 SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3")
61 SHOW(BUTTON3_RESERVED_EVENT, "reserved-3")
62 SHOW(BUTTON4_RELEASED, "release-4")
63 SHOW(BUTTON4_PRESSED, "press-4")
64 SHOW(BUTTON4_CLICKED, "click-4")
65 SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4")
66 SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4")
67 SHOW(BUTTON4_RESERVED_EVENT, "reserved-4")
68 SHOW(BUTTON_CTRL, "ctrl")
69 SHOW(BUTTON_SHIFT, "shift")
70 SHOW(BUTTON_ALT, "alt")
71 SHOW(ALL_MOUSE_EVENTS, "all-events")
72 SHOW(REPORT_MOUSE_POSITION, "position")
75 if (buf[strlen(buf)-1] == ' ')
76 buf[strlen(buf)-2] = '\0';
77 (void) strcat(buf, "}");