comparison src/term.c @ 12895:d872005ecfcd v8.0.1324

patch 8.0.1324: some xterm sends different mouse move codes commit https://github.com/vim/vim/commit/bb160a188abb3c40258d3e5726524ce203333e84 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 20 21:52:24 2017 +0100 patch 8.0.1324: some xterm sends different mouse move codes Problem: Some xterm sends different mouse move codes. Solution: Also accept 0x80 as a move event.
author Christian Brabandt <cb@256bit.org>
date Mon, 20 Nov 2017 22:00:07 +0100
parents ebb4f6c93598
children e775011b4c1e
comparison
equal deleted inserted replaced
12894:8b3dc59c992f 12895:d872005ecfcd
4978 * 0x61 = button 5 down (scroll wheel up) 4978 * 0x61 = button 5 down (scroll wheel up)
4979 * add 0x04 for SHIFT 4979 * add 0x04 for SHIFT
4980 * add 0x08 for ALT 4980 * add 0x08 for ALT
4981 * add 0x10 for CTRL 4981 * add 0x10 for CTRL
4982 * add 0x20 for mouse drag (0x40 is drag with left button) 4982 * add 0x20 for mouse drag (0x40 is drag with left button)
4983 * add 0x40 for mouse move (0x80 is move, 0x81 too)
4984 * 0x43 (drag + release) is also move
4983 * c == column + ' ' + 1 == column + 33 4985 * c == column + ' ' + 1 == column + 33
4984 * r == row + ' ' + 1 == row + 33 4986 * r == row + ' ' + 1 == row + 33
4985 * 4987 *
4986 * The coordinates are passed on through global variables. 4988 * The coordinates are passed on through global variables.
4987 * Ugly, but this avoids trouble with mouse clicks at an 4989 * Ugly, but this avoids trouble with mouse clicks at an
5119 # ifdef FEAT_MOUSE_GPM 5121 # ifdef FEAT_MOUSE_GPM
5120 && gpm_flag == 0 5122 && gpm_flag == 0
5121 # endif 5123 # endif
5122 ) 5124 )
5123 { 5125 {
5124 /* Keep the mouse_code before it's changed, so that we 5126 # if defined(UNIX) && defined(FEAT_MOUSE_TTY)
5125 * remember that it was a mouse wheel click. */ 5127 if (use_xterm_mouse() > 1 && mouse_code >= 0x80)
5126 wheel_code = mouse_code; 5128 /* mouse-move event, using MOUSE_DRAG works */
5129 mouse_code = MOUSE_DRAG;
5130 else
5131 # endif
5132 /* Keep the mouse_code before it's changed, so that we
5133 * remember that it was a mouse wheel click. */
5134 wheel_code = mouse_code;
5127 } 5135 }
5128 # ifdef FEAT_MOUSE_XTERM 5136 # ifdef FEAT_MOUSE_XTERM
5129 else if (held_button == MOUSE_RELEASE 5137 else if (held_button == MOUSE_RELEASE
5130 # ifdef FEAT_GUI 5138 # ifdef FEAT_GUI
5131 && !gui.in_use 5139 && !gui.in_use