Mercurial > vim
comparison src/term.c @ 9929:579abc260d85 v7.4.2238
commit https://github.com/vim/vim/commit/de7762a2c1498e2dc43586feb5f982d661799f85
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 21 21:03:37 2016 +0200
patch 7.4.2238
Problem: With SGR mouse reporting (suckless terminal) the mouse release and
scroll up/down is confused.
Solution: Don't see a release as a scroll up/down. (Ralph Eastwood)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 21 Aug 2016 21:15:06 +0200 |
parents | 989d44d35a66 |
children | ccb6461b82df |
comparison
equal
deleted
inserted
replaced
9928:16a7dee7239c | 9929:579abc260d85 |
---|---|
4937 return -1; | 4937 return -1; |
4938 | 4938 |
4939 button = getdigits(&p); | 4939 button = getdigits(&p); |
4940 mouse_code = 0; | 4940 mouse_code = 0; |
4941 | 4941 |
4942 switch( button ) | 4942 switch (button) |
4943 { | 4943 { |
4944 case 4: mouse_code = MOUSE_LEFT; break; | 4944 case 4: mouse_code = MOUSE_LEFT; break; |
4945 case 1: mouse_code = MOUSE_RIGHT; break; | 4945 case 1: mouse_code = MOUSE_RIGHT; break; |
4946 case 2: mouse_code = MOUSE_MIDDLE; break; | 4946 case 2: mouse_code = MOUSE_MIDDLE; break; |
4947 default: return -1; | 4947 default: return -1; |
4948 } | 4948 } |
4949 | 4949 |
4950 switch( action ) | 4950 switch (action) |
4951 { | 4951 { |
4952 case 31: /* Initial press */ | 4952 case 31: /* Initial press */ |
4953 if (*p++ != ';') | 4953 if (*p++ != ';') |
4954 return -1; | 4954 return -1; |
4955 | 4955 |
5094 else if (orig_num_clicks == 3) | 5094 else if (orig_num_clicks == 3) |
5095 modifiers |= MOD_MASK_3CLICK; | 5095 modifiers |= MOD_MASK_3CLICK; |
5096 else if (orig_num_clicks == 4) | 5096 else if (orig_num_clicks == 4) |
5097 modifiers |= MOD_MASK_4CLICK; | 5097 modifiers |= MOD_MASK_4CLICK; |
5098 | 5098 |
5099 /* Work out our pseudo mouse event */ | 5099 /* Work out our pseudo mouse event. Note that MOUSE_RELEASE gets |
5100 * added, then it's not mouse up/down. */ | |
5100 key_name[0] = (int)KS_EXTRA; | 5101 key_name[0] = (int)KS_EXTRA; |
5101 if (wheel_code != 0) | 5102 if (wheel_code != 0 |
5103 && (wheel_code & MOUSE_RELEASE) != MOUSE_RELEASE) | |
5102 { | 5104 { |
5103 if (wheel_code & MOUSE_CTRL) | 5105 if (wheel_code & MOUSE_CTRL) |
5104 modifiers |= MOD_MASK_CTRL; | 5106 modifiers |= MOD_MASK_CTRL; |
5105 if (wheel_code & MOUSE_ALT) | 5107 if (wheel_code & MOUSE_ALT) |
5106 modifiers |= MOD_MASK_ALT; | 5108 modifiers |= MOD_MASK_ALT; |