| skipped 73 lines |
74 | 74 | | return win; |
75 | 75 | | } |
76 | 76 | | |
| 77 | + | static void dump_event(MEVENT *event) |
| 78 | + | { |
| 79 | + | mutt_debug(LL_DEBUG1, "x = %d, y = %d, z = %d\n", event->x, event->y, event->z); |
| 80 | + | |
| 81 | + | unsigned long s = event->bstate; |
| 82 | + | |
| 83 | + | // clang-format off |
| 84 | + | if (s & BUTTON_CTRL) { mutt_debug(LL_DEBUG1, "CTRL\n"); s &= ~BUTTON_CTRL; } |
| 85 | + | if (s & BUTTON_SHIFT) { mutt_debug(LL_DEBUG1, "SHIFT\n"); s &= ~BUTTON_SHIFT; } |
| 86 | + | if (s & BUTTON_ALT) { mutt_debug(LL_DEBUG1, "ALT\n"); s &= ~BUTTON_ALT; } |
| 87 | + | |
| 88 | + | if (s & BUTTON1_RELEASED) { mutt_debug(LL_DEBUG1, "BUT1-release\n"); s &= ~BUTTON1_RELEASED; } |
| 89 | + | if (s & BUTTON1_PRESSED) { mutt_debug(LL_DEBUG1, "BUT1-pressed\n"); s &= ~BUTTON1_PRESSED; } |
| 90 | + | if (s & BUTTON1_CLICKED) { mutt_debug(LL_DEBUG1, "BUT1-clicked\n"); s &= ~BUTTON1_CLICKED; } |
| 91 | + | if (s & BUTTON1_DOUBLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT1-double\n"); s &= ~BUTTON1_DOUBLE_CLICKED; } |
| 92 | + | if (s & BUTTON1_TRIPLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT1-triple\n"); s &= ~BUTTON1_TRIPLE_CLICKED; } |
| 93 | + | |
| 94 | + | if (s & BUTTON2_RELEASED) { mutt_debug(LL_DEBUG1, "BUT2-release\n"); s &= ~BUTTON2_RELEASED; } |
| 95 | + | if (s & BUTTON2_PRESSED) { mutt_debug(LL_DEBUG1, "BUT2-pressed\n"); s &= ~BUTTON2_PRESSED; } |
| 96 | + | if (s & BUTTON2_CLICKED) { mutt_debug(LL_DEBUG1, "BUT2-clicked\n"); s &= ~BUTTON2_CLICKED; } |
| 97 | + | if (s & BUTTON2_DOUBLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT2-double\n"); s &= ~BUTTON2_DOUBLE_CLICKED; } |
| 98 | + | if (s & BUTTON2_TRIPLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT2-triple\n"); s &= ~BUTTON2_TRIPLE_CLICKED; } |
| 99 | + | |
| 100 | + | if (s & BUTTON3_RELEASED) { mutt_debug(LL_DEBUG1, "BUT3-release\n"); s &= ~BUTTON3_RELEASED; } |
| 101 | + | if (s & BUTTON3_PRESSED) { mutt_debug(LL_DEBUG1, "BUT3-pressed\n"); s &= ~BUTTON3_PRESSED; } |
| 102 | + | if (s & BUTTON3_CLICKED) { mutt_debug(LL_DEBUG1, "BUT3-clicked\n"); s &= ~BUTTON3_CLICKED; } |
| 103 | + | if (s & BUTTON3_DOUBLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT3-double\n"); s &= ~BUTTON3_DOUBLE_CLICKED; } |
| 104 | + | if (s & BUTTON3_TRIPLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT3-triple\n"); s &= ~BUTTON3_TRIPLE_CLICKED; } |
| 105 | + | |
| 106 | + | if (s & BUTTON4_RELEASED) { mutt_debug(LL_DEBUG1, "BUT4-release\n"); s &= ~BUTTON4_RELEASED; } |
| 107 | + | if (s & BUTTON4_PRESSED) { mutt_debug(LL_DEBUG1, "BUT4-pressed\n"); s &= ~BUTTON4_PRESSED; } |
| 108 | + | if (s & BUTTON4_CLICKED) { mutt_debug(LL_DEBUG1, "BUT4-clicked\n"); s &= ~BUTTON4_CLICKED; } |
| 109 | + | if (s & BUTTON4_DOUBLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT4-double\n"); s &= ~BUTTON4_DOUBLE_CLICKED; } |
| 110 | + | if (s & BUTTON4_TRIPLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT4-triple\n"); s &= ~BUTTON4_TRIPLE_CLICKED; } |
| 111 | + | |
| 112 | + | if (s & BUTTON5_RELEASED) { mutt_debug(LL_DEBUG1, "BUT5-release\n"); s &= ~BUTTON5_RELEASED; } |
| 113 | + | if (s & BUTTON5_PRESSED) { mutt_debug(LL_DEBUG1, "BUT5-pressed\n"); s &= ~BUTTON5_PRESSED; } |
| 114 | + | if (s & BUTTON5_CLICKED) { mutt_debug(LL_DEBUG1, "BUT5-clicked\n"); s &= ~BUTTON5_CLICKED; } |
| 115 | + | if (s & BUTTON5_DOUBLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT5-double\n"); s &= ~BUTTON5_DOUBLE_CLICKED; } |
| 116 | + | if (s & BUTTON5_TRIPLE_CLICKED) { mutt_debug(LL_DEBUG1, "BUT5-triple\n"); s &= ~BUTTON5_TRIPLE_CLICKED; } |
| 117 | + | |
| 118 | + | if (s & 268435456) { mutt_debug(LL_DEBUG1, "268435456\n"); s &= ~268435456; } |
| 119 | + | // clang-format on |
| 120 | + | |
| 121 | + | if (s != 0) |
| 122 | + | mutt_debug(LL_DEBUG1, "s = %lu\n", s); |
| 123 | + | } |
| 124 | + | |
77 | 125 | | /** |
78 | 126 | | * mouse_handle_event - Process mouse events |
79 | 127 | | * @param ch Character, from getch() |
| skipped 7 lines |
87 | 135 | | if (!RootWindow) |
88 | 136 | | return true; |
89 | 137 | | |
90 | | - | MEVENT event; |
| 138 | + | MEVENT event = { 0 }; |
91 | 139 | | if (getmouse(&event) != OK) |
92 | 140 | | return true; |
| 141 | + | |
| 142 | + | dump_event(&event); |
93 | 143 | | |
94 | 144 | | struct MuttWindow *win = window_by_posn(RootWindow, event.x, event.y); |
95 | 145 | | |
| skipped 16 lines |