diff src/os_win32.c @ 13416:e534e8b21fd7 v8.0.1582

patch 8.0.1582: in the MS-Windows console mouse movement is not used commit https://github.com/vim/vim/commit/157d813be41c122e210b0eb1cd1e862fbddbf665 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 6 17:09:20 2018 +0100 patch 8.0.1582: in the MS-Windows console mouse movement is not used Problem: In the MS-Windows console mouse movement is not used. Solution: Pass mouse movement events when useful.
author Christian Brabandt <cb@256bit.org>
date Tue, 06 Mar 2018 17:15:06 +0100
parents 69517d67421f
children a23300c1c1cf
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1164,6 +1164,18 @@ mch_setmouse(int on)
     SetConsoleMode(g_hConIn, cmodein);
 }
 
+
+#if defined(FEAT_BEVAL_TERM) || defined(PROTO)
+/*
+ * Called when 'balloonevalterm' changed.
+ */
+    void
+mch_bevalterm_changed(void)
+{
+    mch_setmouse(g_fMouseActive);
+}
+#endif
+
 /*
  * Decode a MOUSE_EVENT.  If it's a valid event, return MOUSE_LEFT,
  * MOUSE_MIDDLE, or MOUSE_RIGHT for a click; MOUSE_DRAG for a mouse
@@ -1243,7 +1255,7 @@ decode_mouse_event(
 
     if (pmer->dwEventFlags == MOUSE_MOVED)
     {
-	/* ignore MOUSE_MOVED events if (x, y) hasn't changed.	(We get these
+	/* Ignore MOUSE_MOVED events if (x, y) hasn't changed.	(We get these
 	 * events even when the mouse moves only within a char cell.) */
 	if (s_xOldMouse == g_xMouse && s_yOldMouse == g_yMouse)
 	    return FALSE;
@@ -1252,11 +1264,20 @@ decode_mouse_event(
     /* If no buttons are pressed... */
     if ((pmer->dwButtonState & ((1 << cButtons) - 1)) == 0)
     {
+	nButton = MOUSE_RELEASE;
+
 	/* If the last thing returned was MOUSE_RELEASE, ignore this */
 	if (s_fReleased)
-	    return FALSE;
-
-	nButton = MOUSE_RELEASE;
+	{
+#ifdef FEAT_BEVAL_TERM
+	    /* do return mouse move events when we want them */
+	    if (p_bevalterm)
+		nButton = MOUSE_DRAG;
+	    else
+#endif
+		return FALSE;
+	}
+
 	s_fReleased = TRUE;
     }
     else    /* one or more buttons pressed */