Problem: GUI: mouse move may start Visual mode with a popup visible.
Solution: Add special code for mouse move. (closes #8318)
*/
switch (button)
{
+ case MOUSE_MOVE:
+ button_char = KE_MOUSEMOVE_XY;
+ goto button_set;
case MOUSE_X1:
button_char = KE_X1MOUSE;
goto button_set;
if (popup_visible)
// Generate a mouse-moved event, so that the popup can perhaps be
// closed, just like in the terminal.
- gui_send_mouse_event(MOUSE_DRAG, x, y, FALSE, 0);
+ gui_send_mouse_event(MOUSE_MOVE, x, y, FALSE, 0);
#endif
}
, KE_FOCUSGAINED = 98 // focus gained
, KE_FOCUSLOST = 99 // focus lost
, KE_MOUSEMOVE = 100 // mouse moved with no button down
- , KE_CANCEL = 101 // return from vgetc()
- , KE_COMMAND = 102 // <Cmd> special key
+ , KE_MOUSEMOVE_XY = 101 // KE_MOUSEMOVE with coordinates
+ , KE_CANCEL = 102 // return from vgetc()
+ , KE_COMMAND = 103 // <Cmd> special key
};
/*
&& key_name[0] == (int)KS_EXTRA
&& (key_name[1] == (int)KE_X1MOUSE
|| key_name[1] == (int)KE_X2MOUSE
+ || key_name[1] == (int)KE_MOUSEMOVE_XY
|| key_name[1] == (int)KE_MOUSELEFT
|| key_name[1] == (int)KE_MOUSERIGHT
|| key_name[1] == (int)KE_MOUSEDOWN
mouse_col = 128 * (bytes[0] - ' ' - 1) + bytes[1] - ' ' - 1;
mouse_row = 128 * (bytes[2] - ' ' - 1) + bytes[3] - ' ' - 1;
slen += num_bytes;
+ // equal to K_MOUSEMOVE
+ if (key_name[1] == (int)KE_MOUSEMOVE_XY)
+ key_name[1] = (int)KE_MOUSEMOVE;
}
else
#endif
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2963,
/**/
2962,
/**/
#define MOUSE_6 0x500 // scroll wheel left
#define MOUSE_7 0x600 // scroll wheel right
+#define MOUSE_MOVE 0x700 // report mouse moved
+
// 0x20 is reserved by xterm
#define MOUSE_DRAG_XTERM 0x40