diff --git a/src/nano.c b/src/nano.c index 3dfc5e12..885df443 100644 --- a/src/nano.c +++ b/src/nano.c @@ -394,7 +394,10 @@ void disable_mouse_support(void) void enable_mouse_support(void) { - mousemask(ALL_MOUSE_EVENTS, NULL); + mousemask(ALL_MOUSE_EVENTS|REPORT_MOUSE_POSITION, NULL); + printf("\e[?1003h\n"); + fflush(stdout); + oldinterval = mouseinterval(50); } diff --git a/src/winio.c b/src/winio.c index ba39f9fd..11673d1a 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1629,6 +1629,22 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts) *mouse_x = mevent.x - margin; *mouse_y = mevent.y; + if (mevent.bstate & BUTTON1_PRESSED) + fprintf(stderr, "button1 pressed\n"); + else if (mevent.bstate & BUTTON1_RELEASED) + fprintf(stderr, "button1 released\n"); + else if (!(mevent.bstate & ( + BUTTON1_RELEASED | + BUTTON2_RELEASED | + BUTTON3_RELEASED | + BUTTON4_RELEASED | + BUTTON1_PRESSED | + BUTTON2_PRESSED | + BUTTON3_PRESSED | + BUTTON4_PRESSED + ))) + fprintf(stderr, "mouse moved\n"); + in_bottomwin = wenclose(bottomwin, *mouse_y, *mouse_x); /* Handle releases/clicks of the first mouse button. */