comparison src/keymap.h @ 11629:1a6daa73590a v8.0.0697

patch 8.0.0697: recorded key sequences may become invalid commit https://github.com/vim/vim/commit/8858498516108432453526f07783f14c9196e112 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 7 13:32:14 2017 +0200 patch 8.0.0697: recorded key sequences may become invalid Problem: Recorded key sequences may become invalid. Solution: Add back KE_SNIFF removed in 7.4.1433. Use fixed numbers for the key_extra enum.
author Christian Brabandt <cb@256bit.org>
date Fri, 07 Jul 2017 13:45:03 +0200
parents 7e5e76d8d451
children 351cf7c67bbe
comparison
equal deleted inserted replaced
11628:81b7662fd2e4 11629:1a6daa73590a
110 /* Used for the urxvt mouse. */ 110 /* Used for the urxvt mouse. */
111 #define KS_URXVT_MOUSE 238 111 #define KS_URXVT_MOUSE 238
112 112
113 /* Used for the sgr mouse. */ 113 /* Used for the sgr mouse. */
114 #define KS_SGR_MOUSE 237 114 #define KS_SGR_MOUSE 237
115 #define KS_SGR_MOUSE_RELEASE 236 /* Release */ 115 #define KS_SGR_MOUSE_RELEASE 236
116 116
117 /* 117 /*
118 * Filler used after KS_SPECIAL and others 118 * Filler used after KS_SPECIAL and others
119 */ 119 */
120 #define KE_FILLER ('X') 120 #define KE_FILLER ('X')
138 */ 138 */
139 #define TO_SPECIAL(a, b) ((a) == KS_SPECIAL ? K_SPECIAL : (a) == KS_ZERO ? K_ZERO : TERMCAP2KEY(a, b)) 139 #define TO_SPECIAL(a, b) ((a) == KS_SPECIAL ? K_SPECIAL : (a) == KS_ZERO ? K_ZERO : TERMCAP2KEY(a, b))
140 140
141 /* 141 /*
142 * Codes for keys that do not have a termcap name. 142 * Codes for keys that do not have a termcap name.
143 * The numbers are fixed to make sure that recorded key sequences remain valid.
144 * Add new entries at the end, not halfway.
143 * 145 *
144 * K_SPECIAL KS_EXTRA KE_xxx 146 * K_SPECIAL KS_EXTRA KE_xxx
145 */ 147 */
146 enum key_extra 148 enum key_extra
147 { 149 {
148 KE_NAME = 3 /* name of this terminal entry */ 150 KE_NAME = 3 /* name of this terminal entry */
149 151
150 , KE_S_UP /* shift-up */ 152 , KE_S_UP = 4 /* shift-up */
151 , KE_S_DOWN /* shift-down */ 153 , KE_S_DOWN = 5 /* shift-down */
152 154
153 , KE_S_F1 /* shifted function keys */ 155 , KE_S_F1 = 6 /* shifted function keys */
154 , KE_S_F2 156 , KE_S_F2 = 7
155 , KE_S_F3 157 , KE_S_F3 = 8
156 , KE_S_F4 158 , KE_S_F4 = 9
157 , KE_S_F5 159 , KE_S_F5 = 10
158 , KE_S_F6 160 , KE_S_F6 = 11
159 , KE_S_F7 161 , KE_S_F7 = 12
160 , KE_S_F8 162 , KE_S_F8 = 13
161 , KE_S_F9 163 , KE_S_F9 = 14
162 , KE_S_F10 164 , KE_S_F10 = 15
163 165
164 , KE_S_F11 166 , KE_S_F11 = 16
165 , KE_S_F12 167 , KE_S_F12 = 17
166 , KE_S_F13 168 , KE_S_F13 = 18
167 , KE_S_F14 169 , KE_S_F14 = 19
168 , KE_S_F15 170 , KE_S_F15 = 20
169 , KE_S_F16 171 , KE_S_F16 = 21
170 , KE_S_F17 172 , KE_S_F17 = 22
171 , KE_S_F18 173 , KE_S_F18 = 23
172 , KE_S_F19 174 , KE_S_F19 = 24
173 , KE_S_F20 175 , KE_S_F20 = 25
174 176
175 , KE_S_F21 177 , KE_S_F21 = 26
176 , KE_S_F22 178 , KE_S_F22 = 27
177 , KE_S_F23 179 , KE_S_F23 = 28
178 , KE_S_F24 180 , KE_S_F24 = 29
179 , KE_S_F25 181 , KE_S_F25 = 30
180 , KE_S_F26 182 , KE_S_F26 = 31
181 , KE_S_F27 183 , KE_S_F27 = 32
182 , KE_S_F28 184 , KE_S_F28 = 33
183 , KE_S_F29 185 , KE_S_F29 = 34
184 , KE_S_F30 186 , KE_S_F30 = 35
185 187
186 , KE_S_F31 188 , KE_S_F31 = 36
187 , KE_S_F32 189 , KE_S_F32 = 37
188 , KE_S_F33 190 , KE_S_F33 = 38
189 , KE_S_F34 191 , KE_S_F34 = 39
190 , KE_S_F35 192 , KE_S_F35 = 40
191 , KE_S_F36 193 , KE_S_F36 = 41
192 , KE_S_F37 194 , KE_S_F37 = 42
193 195
194 , KE_MOUSE /* mouse event start */ 196 , KE_MOUSE = 43 /* mouse event start */
195 197
196 /* 198 /*
197 * Symbols for pseudo keys which are translated from the real key symbols 199 * Symbols for pseudo keys which are translated from the real key symbols
198 * above. 200 * above.
199 */ 201 */
200 , KE_LEFTMOUSE /* Left mouse button click */ 202 , KE_LEFTMOUSE = 44 /* Left mouse button click */
201 , KE_LEFTDRAG /* Drag with left mouse button down */ 203 , KE_LEFTDRAG = 45 /* Drag with left mouse button down */
202 , KE_LEFTRELEASE /* Left mouse button release */ 204 , KE_LEFTRELEASE = 46 /* Left mouse button release */
203 , KE_MIDDLEMOUSE /* Middle mouse button click */ 205 , KE_MIDDLEMOUSE = 47 /* Middle mouse button click */
204 , KE_MIDDLEDRAG /* Drag with middle mouse button down */ 206 , KE_MIDDLEDRAG = 48 /* Drag with middle mouse button down */
205 , KE_MIDDLERELEASE /* Middle mouse button release */ 207 , KE_MIDDLERELEASE = 49 /* Middle mouse button release */
206 , KE_RIGHTMOUSE /* Right mouse button click */ 208 , KE_RIGHTMOUSE = 50 /* Right mouse button click */
207 , KE_RIGHTDRAG /* Drag with right mouse button down */ 209 , KE_RIGHTDRAG = 51 /* Drag with right mouse button down */
208 , KE_RIGHTRELEASE /* Right mouse button release */ 210 , KE_RIGHTRELEASE = 52 /* Right mouse button release */
209 211
210 , KE_IGNORE /* Ignored mouse drag/release */ 212 , KE_IGNORE = 53 /* Ignored mouse drag/release */
211 213
212 , KE_TAB /* unshifted TAB key */ 214 , KE_TAB = 54 /* unshifted TAB key */
213 , KE_S_TAB_OLD /* shifted TAB key (no longer used) */ 215 , KE_S_TAB_OLD = 55 /* shifted TAB key (no longer used) */
214 216
215 , KE_XF1 /* extra vt100 function keys for xterm */ 217 , KE_SNIFF_UNUSED = 56 /* obsolete */
216 , KE_XF2 218 , KE_XF1 = 57 /* extra vt100 function keys for xterm */
217 , KE_XF3 219 , KE_XF2 = 58
218 , KE_XF4 220 , KE_XF3 = 59
219 , KE_XEND /* extra (vt100) end key for xterm */ 221 , KE_XF4 = 60
220 , KE_ZEND /* extra (vt100) end key for xterm */ 222 , KE_XEND = 61 /* extra (vt100) end key for xterm */
221 , KE_XHOME /* extra (vt100) home key for xterm */ 223 , KE_ZEND = 62 /* extra (vt100) end key for xterm */
222 , KE_ZHOME /* extra (vt100) home key for xterm */ 224 , KE_XHOME = 63 /* extra (vt100) home key for xterm */
223 , KE_XUP /* extra vt100 cursor keys for xterm */ 225 , KE_ZHOME = 64 /* extra (vt100) home key for xterm */
224 , KE_XDOWN 226 , KE_XUP = 65 /* extra vt100 cursor keys for xterm */
225 , KE_XLEFT 227 , KE_XDOWN = 66
226 , KE_XRIGHT 228 , KE_XLEFT = 67
227 229 , KE_XRIGHT = 68
228 , KE_LEFTMOUSE_NM /* non-mappable Left mouse button click */ 230
229 , KE_LEFTRELEASE_NM /* non-mappable left mouse button release */ 231 , KE_LEFTMOUSE_NM = 69 /* non-mappable Left mouse button click */
230 232 , KE_LEFTRELEASE_NM = 70 /* non-mappable left mouse button release */
231 , KE_S_XF1 /* extra vt100 shifted function keys for xterm */ 233
232 , KE_S_XF2 234 , KE_S_XF1 = 71 /* vt100 shifted function keys for xterm */
233 , KE_S_XF3 235 , KE_S_XF2 = 72
234 , KE_S_XF4 236 , KE_S_XF3 = 73
237 , KE_S_XF4 = 74
235 238
236 /* NOTE: The scroll wheel events are inverted: i.e. UP is the same as 239 /* NOTE: The scroll wheel events are inverted: i.e. UP is the same as
237 * moving the actual scroll wheel down, LEFT is the same as moving the 240 * moving the actual scroll wheel down, LEFT is the same as moving the
238 * scroll wheel right. */ 241 * scroll wheel right. */
239 , KE_MOUSEDOWN /* scroll wheel pseudo-button Down */ 242 , KE_MOUSEDOWN = 75 /* scroll wheel pseudo-button Down */
240 , KE_MOUSEUP /* scroll wheel pseudo-button Up */ 243 , KE_MOUSEUP = 76 /* scroll wheel pseudo-button Up */
241 , KE_MOUSELEFT /* scroll wheel pseudo-button Left */ 244 , KE_MOUSELEFT = 77 /* scroll wheel pseudo-button Left */
242 , KE_MOUSERIGHT /* scroll wheel pseudo-button Right */ 245 , KE_MOUSERIGHT = 78 /* scroll wheel pseudo-button Right */
243 246
244 , KE_KINS /* keypad Insert key */ 247 , KE_KINS = 79 /* keypad Insert key */
245 , KE_KDEL /* keypad Delete key */ 248 , KE_KDEL = 80 /* keypad Delete key */
246 249
247 , KE_CSI /* CSI typed directly */ 250 , KE_CSI = 81 /* CSI typed directly */
248 , KE_SNR /* <SNR> */ 251 , KE_SNR = 82 /* <SNR> */
249 , KE_PLUG /* <Plug> */ 252 , KE_PLUG = 83 /* <Plug> */
250 , KE_CMDWIN /* open command-line window from Command-line Mode */ 253 , KE_CMDWIN = 84 /* open command-line window from Command-line Mode */
251 254
252 , KE_C_LEFT /* control-left */ 255 , KE_C_LEFT = 85 /* control-left */
253 , KE_C_RIGHT /* control-right */ 256 , KE_C_RIGHT = 86 /* control-right */
254 , KE_C_HOME /* control-home */ 257 , KE_C_HOME = 87 /* control-home */
255 , KE_C_END /* control-end */ 258 , KE_C_END = 88 /* control-end */
256 259
257 , KE_X1MOUSE /* X1/X2 mouse-buttons */ 260 , KE_X1MOUSE = 89 /* X1/X2 mouse-buttons */
258 , KE_X1DRAG 261 , KE_X1DRAG = 90
259 , KE_X1RELEASE 262 , KE_X1RELEASE = 91
260 , KE_X2MOUSE 263 , KE_X2MOUSE = 92
261 , KE_X2DRAG 264 , KE_X2DRAG = 93
262 , KE_X2RELEASE 265 , KE_X2RELEASE = 94
263 266
264 , KE_DROP /* DnD data is available */ 267 , KE_DROP = 95 /* DnD data is available */
265 , KE_CURSORHOLD /* CursorHold event */ 268 , KE_CURSORHOLD = 96 /* CursorHold event */
266 , KE_NOP /* doesn't do something */ 269 , KE_NOP = 97 /* doesn't do something */
267 , KE_FOCUSGAINED /* focus gained */ 270 , KE_FOCUSGAINED = 98 /* focus gained */
268 , KE_FOCUSLOST /* focus lost */ 271 , KE_FOCUSLOST = 99 /* focus lost */
269 }; 272 };
270 273
271 /* 274 /*
272 * the three byte codes are replaced with the following int when using vgetc() 275 * the three byte codes are replaced with the following int when using vgetc()
273 */ 276 */