keymap.h
Go to the documentation of this file.
1 #ifndef NVIM_KEYMAP_H
2 #define NVIM_KEYMAP_H
3 
4 #include "nvim/strings.h"
5 
6 /*
7  * Keycode definitions for special keys.
8  *
9  * Any special key code sequences are replaced by these codes.
10  */
11 
12 /*
13  * For MSDOS some keys produce codes larger than 0xff. They are split into two
14  * chars, the first one is K_NUL.
15  */
16 #define K_NUL (0xce) /* for MSDOS: special key follows */
17 
18 /*
19  * K_SPECIAL is the first byte of a special key code and is always followed by
20  * two bytes.
21  * The second byte can have any value. ASCII is used for normal termcap
22  * entries, 0x80 and higher for special keys, see below.
23  * The third byte is guaranteed to be between 0x02 and 0x7f.
24  */
25 
26 #define K_SPECIAL (0x80)
27 
28 /*
29  * Positive characters are "normal" characters.
30  * Negative characters are special key codes. Only characters below -0x200
31  * are used to so that the absolute value can't be mistaken for a single-byte
32  * character.
33  */
34 #define IS_SPECIAL(c) ((c) < 0)
35 
36 /*
37  * Characters 0x0100 - 0x01ff have a special meaning for abbreviations.
38  * Multi-byte characters also have ABBR_OFF added, thus are above 0x0200.
39  */
40 #define ABBR_OFF 0x100
41 
42 /*
43  * NUL cannot be in the input string, therefore it is replaced by
44  * K_SPECIAL KS_ZERO KE_FILLER
45  */
46 #define KS_ZERO 255
47 
48 /*
49  * K_SPECIAL cannot be in the input string, therefore it is replaced by
50  * K_SPECIAL KS_SPECIAL KE_FILLER
51  */
52 #define KS_SPECIAL 254
53 
54 /*
55  * KS_EXTRA is used for keys that have no termcap name
56  * K_SPECIAL KS_EXTRA KE_xxx
57  */
58 #define KS_EXTRA 253
59 
60 /*
61  * KS_MODIFIER is used when a modifier is given for a (special) key
62  * K_SPECIAL KS_MODIFIER bitmask
63  */
64 #define KS_MODIFIER 252
65 
66 /*
67  * These are used for the GUI
68  * K_SPECIAL KS_xxx KE_FILLER
69  */
70 #define KS_MOUSE 251
71 #define KS_MENU 250
72 #define KS_VER_SCROLLBAR 249
73 #define KS_HOR_SCROLLBAR 248
74 
75 /*
76  * Used for switching Select mode back on after a mapping or menu.
77  */
78 #define KS_SELECT 245
79 #define K_SELECT_STRING (char_u *)"\200\365X"
80 
81 /* Used a termcap entry that produces a normal character. */
82 #define KS_KEY 242
83 
84 /* Used for click in a tab pages label. */
85 #define KS_TABLINE 240
86 
87 /* Used for menu in a tab pages line. */
88 #define KS_TABMENU 239
89 
90 /*
91  * Filler used after KS_SPECIAL and others
92  */
93 #define KE_FILLER ('X')
94 
95 /*
96  * translation of three byte code "K_SPECIAL a b" into int "K_xxx" and back
97  */
98 #define TERMCAP2KEY(a, b) (-((a) + ((int)(b) << 8)))
99 #define KEY2TERMCAP0(x) ((-(x)) & 0xff)
100 #define KEY2TERMCAP1(x) (((unsigned)(-(x)) >> 8) & 0xff)
101 
102 /*
103  * get second or third byte when translating special key code into three bytes
104  */
105 #define K_SECOND(c) ((c) == K_SPECIAL ? KS_SPECIAL : (c) == \
106  NUL ? KS_ZERO : KEY2TERMCAP0(c))
107 
108 #define K_THIRD(c) (((c) == K_SPECIAL || (c) == \
109  NUL) ? KE_FILLER : KEY2TERMCAP1(c))
110 
111 /*
112  * get single int code from second byte after K_SPECIAL
113  */
114 #define TO_SPECIAL(a, b) ((a) == KS_SPECIAL ? K_SPECIAL : (a) == \
115  KS_ZERO ? K_ZERO : TERMCAP2KEY(a, b))
116 
117 // Codes for keys that do not have a termcap name.
118 // The numbers are fixed to make sure that recorded key sequences remain valid.
119 // Add new entries at the end, not halfway.
120 //
121 // K_SPECIAL KS_EXTRA KE_xxx
122 //
123 // Entries must be in the range 0x02-0x7f (see comment at K_SPECIAL).
124 enum key_extra {
125  KE_NAME = 3 // name of this terminal entry
126 
127  , KE_S_UP = 4 // shift-up
128  , KE_S_DOWN = 5 // shift-down
129 
130  , KE_S_F1 = 6 // shifted function keys
131  , KE_S_F2 = 7
132  , KE_S_F3 = 8
133  , KE_S_F4 = 9
134  , KE_S_F5 = 10
135  , KE_S_F6 = 11
136  , KE_S_F7 = 12
137  , KE_S_F8 = 13
138  , KE_S_F9 = 14
139  , KE_S_F10 = 15
140 
141  , KE_S_F11 = 16
142  , KE_S_F12 = 17
143  , KE_S_F13 = 18
144  , KE_S_F14 = 19
145  , KE_S_F15 = 20
146  , KE_S_F16 = 21
147  , KE_S_F17 = 22
148  , KE_S_F18 = 23
149  , KE_S_F19 = 24
150  , KE_S_F20 = 25
151 
152  , KE_S_F21 = 26
153  , KE_S_F22 = 27
154  , KE_S_F23 = 28
155  , KE_S_F24 = 29
156  , KE_S_F25 = 30
157  , KE_S_F26 = 31
158  , KE_S_F27 = 32
159  , KE_S_F28 = 33
160  , KE_S_F29 = 34
161  , KE_S_F30 = 35
162 
163  , KE_S_F31 = 36
164  , KE_S_F32 = 37
165  , KE_S_F33 = 38
166  , KE_S_F34 = 39
167  , KE_S_F35 = 40
168  , KE_S_F36 = 41
169  , KE_S_F37 = 42
170 
171  , KE_MOUSE = 43 // mouse event start
172 
173  // Symbols for pseudo keys which are translated from the real key symbols
174  // above.
175  , KE_LEFTMOUSE = 44 // Left mouse button click
176  , KE_LEFTDRAG = 45 // Drag with left mouse button down
177  , KE_LEFTRELEASE = 46 // Left mouse button release
178  , KE_MIDDLEMOUSE = 47 // Middle mouse button click
179  , KE_MIDDLEDRAG = 48 // Drag with middle mouse button down
180  , KE_MIDDLERELEASE = 49 // Middle mouse button release
181  , KE_RIGHTMOUSE = 50 // Right mouse button click
182  , KE_RIGHTDRAG = 51 // Drag with right mouse button down
183  , KE_RIGHTRELEASE = 52 // Right mouse button release
184 
185  , KE_IGNORE = 53 // Ignored mouse drag/release
186 
187  , KE_TAB = 54 // unshifted TAB key
188  , KE_S_TAB_OLD = 55 // shifted TAB key (no longer used)
189 
190  // , KE_SNIFF_UNUSED = 56 // obsolete
191  , KE_XF1 = 57 // extra vt100 function keys for xterm
192  , KE_XF2 = 58
193  , KE_XF3 = 59
194  , KE_XF4 = 60
195  , KE_XEND = 61 // extra (vt100) end key for xterm
196  , KE_ZEND = 62 // extra (vt100) end key for xterm
197  , KE_XHOME = 63 // extra (vt100) home key for xterm
198  , KE_ZHOME = 64 // extra (vt100) home key for xterm
199  , KE_XUP = 65 // extra vt100 cursor keys for xterm
200  , KE_XDOWN = 66
201  , KE_XLEFT = 67
202  , KE_XRIGHT = 68
203 
204  , KE_LEFTMOUSE_NM = 69 // non-mappable Left mouse button click
205  , KE_LEFTRELEASE_NM = 70 // non-mappable left mouse button release
206 
207  , KE_S_XF1 = 71 // vt100 shifted function keys for xterm
208  , KE_S_XF2 = 72
209  , KE_S_XF3 = 73
210  , KE_S_XF4 = 74
211 
212  // NOTE: The scroll wheel events are inverted: i.e. UP is the same as
213  // moving the actual scroll wheel down, LEFT is the same as moving the
214  // scroll wheel right.
215  , KE_MOUSEDOWN = 75 // scroll wheel pseudo-button Down
216  , KE_MOUSEUP = 76 // scroll wheel pseudo-button Up
217  , KE_MOUSELEFT = 77 // scroll wheel pseudo-button Left
218  , KE_MOUSERIGHT = 78 // scroll wheel pseudo-button Right
219 
220  , KE_KINS = 79 // keypad Insert key
221  , KE_KDEL = 80 // keypad Delete key
222 
223  , KE_CSI = 81 // CSI typed directly
224  , KE_SNR = 82 // <SNR>
225  , KE_PLUG = 83 // <Plug>
226  , KE_CMDWIN = 84 // open command-line window from Command-line Mode
227 
228  , KE_C_LEFT = 85 // control-left
229  , KE_C_RIGHT = 86 // control-right
230  , KE_C_HOME = 87 // control-home
231  , KE_C_END = 88 // control-end
232 
233  , KE_X1MOUSE = 89 // X1/X2 mouse-buttons
234  , KE_X1DRAG = 90
236  , KE_X2MOUSE = 92
237  , KE_X2DRAG = 93
239 
240  , KE_DROP = 95 // DnD data is available
241  // , KE_CURSORHOLD = 96 // CursorHold event
242  , KE_NOP = 97 // doesn't do something
243  , KE_FOCUSGAINED = 98 // focus gained
244  , KE_FOCUSLOST = 99 // focus lost
245  // , KE_MOUSEMOVE = 100 // mouse moved with no button down
246  // , KE_CANCEL = 101 // return from vgetc
247  , KE_EVENT = 102 // event
248  , KE_PASTE = 103 // special key to toggle the 'paste' option.
249  // sent only by UIs
250  , KE_COMMAND = 104 // <Cmd> special key
251 };
252 
253 /*
254  * the three byte codes are replaced with the following int when using vgetc()
255  */
256 #define K_ZERO TERMCAP2KEY(KS_ZERO, KE_FILLER)
257 
258 #define K_UP TERMCAP2KEY('k', 'u')
259 #define K_DOWN TERMCAP2KEY('k', 'd')
260 #define K_LEFT TERMCAP2KEY('k', 'l')
261 #define K_RIGHT TERMCAP2KEY('k', 'r')
262 #define K_S_UP TERMCAP2KEY(KS_EXTRA, KE_S_UP)
263 #define K_S_DOWN TERMCAP2KEY(KS_EXTRA, KE_S_DOWN)
264 #define K_S_LEFT TERMCAP2KEY('#', '4')
265 #define K_C_LEFT TERMCAP2KEY(KS_EXTRA, KE_C_LEFT)
266 #define K_S_RIGHT TERMCAP2KEY('%', 'i')
267 #define K_C_RIGHT TERMCAP2KEY(KS_EXTRA, KE_C_RIGHT)
268 #define K_S_HOME TERMCAP2KEY('#', '2')
269 #define K_C_HOME TERMCAP2KEY(KS_EXTRA, KE_C_HOME)
270 #define K_S_END TERMCAP2KEY('*', '7')
271 #define K_C_END TERMCAP2KEY(KS_EXTRA, KE_C_END)
272 #define K_TAB TERMCAP2KEY(KS_EXTRA, KE_TAB)
273 #define K_S_TAB TERMCAP2KEY('k', 'B')
274 
275 /* extra set of function keys F1-F4, for vt100 compatible xterm */
276 #define K_XF1 TERMCAP2KEY(KS_EXTRA, KE_XF1)
277 #define K_XF2 TERMCAP2KEY(KS_EXTRA, KE_XF2)
278 #define K_XF3 TERMCAP2KEY(KS_EXTRA, KE_XF3)
279 #define K_XF4 TERMCAP2KEY(KS_EXTRA, KE_XF4)
280 
281 /* extra set of cursor keys for vt100 compatible xterm */
282 #define K_XUP TERMCAP2KEY(KS_EXTRA, KE_XUP)
283 #define K_XDOWN TERMCAP2KEY(KS_EXTRA, KE_XDOWN)
284 #define K_XLEFT TERMCAP2KEY(KS_EXTRA, KE_XLEFT)
285 #define K_XRIGHT TERMCAP2KEY(KS_EXTRA, KE_XRIGHT)
286 
287 #define K_F1 TERMCAP2KEY('k', '1') /* function keys */
288 #define K_F2 TERMCAP2KEY('k', '2')
289 #define K_F3 TERMCAP2KEY('k', '3')
290 #define K_F4 TERMCAP2KEY('k', '4')
291 #define K_F5 TERMCAP2KEY('k', '5')
292 #define K_F6 TERMCAP2KEY('k', '6')
293 #define K_F7 TERMCAP2KEY('k', '7')
294 #define K_F8 TERMCAP2KEY('k', '8')
295 #define K_F9 TERMCAP2KEY('k', '9')
296 #define K_F10 TERMCAP2KEY('k', ';')
297 
298 #define K_F11 TERMCAP2KEY('F', '1')
299 #define K_F12 TERMCAP2KEY('F', '2')
300 #define K_F13 TERMCAP2KEY('F', '3')
301 #define K_F14 TERMCAP2KEY('F', '4')
302 #define K_F15 TERMCAP2KEY('F', '5')
303 #define K_F16 TERMCAP2KEY('F', '6')
304 #define K_F17 TERMCAP2KEY('F', '7')
305 #define K_F18 TERMCAP2KEY('F', '8')
306 #define K_F19 TERMCAP2KEY('F', '9')
307 #define K_F20 TERMCAP2KEY('F', 'A')
308 
309 #define K_F21 TERMCAP2KEY('F', 'B')
310 #define K_F22 TERMCAP2KEY('F', 'C')
311 #define K_F23 TERMCAP2KEY('F', 'D')
312 #define K_F24 TERMCAP2KEY('F', 'E')
313 #define K_F25 TERMCAP2KEY('F', 'F')
314 #define K_F26 TERMCAP2KEY('F', 'G')
315 #define K_F27 TERMCAP2KEY('F', 'H')
316 #define K_F28 TERMCAP2KEY('F', 'I')
317 #define K_F29 TERMCAP2KEY('F', 'J')
318 #define K_F30 TERMCAP2KEY('F', 'K')
319 
320 #define K_F31 TERMCAP2KEY('F', 'L')
321 #define K_F32 TERMCAP2KEY('F', 'M')
322 #define K_F33 TERMCAP2KEY('F', 'N')
323 #define K_F34 TERMCAP2KEY('F', 'O')
324 #define K_F35 TERMCAP2KEY('F', 'P')
325 #define K_F36 TERMCAP2KEY('F', 'Q')
326 #define K_F37 TERMCAP2KEY('F', 'R')
327 
328 /* extra set of shifted function keys F1-F4, for vt100 compatible xterm */
329 #define K_S_XF1 TERMCAP2KEY(KS_EXTRA, KE_S_XF1)
330 #define K_S_XF2 TERMCAP2KEY(KS_EXTRA, KE_S_XF2)
331 #define K_S_XF3 TERMCAP2KEY(KS_EXTRA, KE_S_XF3)
332 #define K_S_XF4 TERMCAP2KEY(KS_EXTRA, KE_S_XF4)
333 
334 #define K_S_F1 TERMCAP2KEY(KS_EXTRA, KE_S_F1) /* shifted func. keys */
335 #define K_S_F2 TERMCAP2KEY(KS_EXTRA, KE_S_F2)
336 #define K_S_F3 TERMCAP2KEY(KS_EXTRA, KE_S_F3)
337 #define K_S_F4 TERMCAP2KEY(KS_EXTRA, KE_S_F4)
338 #define K_S_F5 TERMCAP2KEY(KS_EXTRA, KE_S_F5)
339 #define K_S_F6 TERMCAP2KEY(KS_EXTRA, KE_S_F6)
340 #define K_S_F7 TERMCAP2KEY(KS_EXTRA, KE_S_F7)
341 #define K_S_F8 TERMCAP2KEY(KS_EXTRA, KE_S_F8)
342 #define K_S_F9 TERMCAP2KEY(KS_EXTRA, KE_S_F9)
343 #define K_S_F10 TERMCAP2KEY(KS_EXTRA, KE_S_F10)
344 
345 #define K_S_F11 TERMCAP2KEY(KS_EXTRA, KE_S_F11)
346 #define K_S_F12 TERMCAP2KEY(KS_EXTRA, KE_S_F12)
347 /* K_S_F13 to K_S_F37 are currently not used */
348 
349 #define K_HELP TERMCAP2KEY('%', '1')
350 #define K_UNDO TERMCAP2KEY('&', '8')
351 
352 #define K_BS TERMCAP2KEY('k', 'b')
353 
354 #define K_INS TERMCAP2KEY('k', 'I')
355 #define K_KINS TERMCAP2KEY(KS_EXTRA, KE_KINS)
356 #define K_DEL TERMCAP2KEY('k', 'D')
357 #define K_KDEL TERMCAP2KEY(KS_EXTRA, KE_KDEL)
358 #define K_HOME TERMCAP2KEY('k', 'h')
359 #define K_KHOME TERMCAP2KEY('K', '1') /* keypad home (upper left) */
360 #define K_XHOME TERMCAP2KEY(KS_EXTRA, KE_XHOME)
361 #define K_ZHOME TERMCAP2KEY(KS_EXTRA, KE_ZHOME)
362 #define K_END TERMCAP2KEY('@', '7')
363 #define K_KEND TERMCAP2KEY('K', '4') /* keypad end (lower left) */
364 #define K_XEND TERMCAP2KEY(KS_EXTRA, KE_XEND)
365 #define K_ZEND TERMCAP2KEY(KS_EXTRA, KE_ZEND)
366 #define K_PAGEUP TERMCAP2KEY('k', 'P')
367 #define K_PAGEDOWN TERMCAP2KEY('k', 'N')
368 #define K_KPAGEUP TERMCAP2KEY('K', '3') /* keypad pageup (upper R.) */
369 #define K_KPAGEDOWN TERMCAP2KEY('K', '5') /* keypad pagedown (lower R.) */
370 
371 #define K_KPLUS TERMCAP2KEY('K', '6') /* keypad plus */
372 #define K_KMINUS TERMCAP2KEY('K', '7') /* keypad minus */
373 #define K_KDIVIDE TERMCAP2KEY('K', '8') /* keypad / */
374 #define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */
375 #define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */
376 #define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . or ,*/
377 
378 #define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */
379 #define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */
380 #define K_K2 TERMCAP2KEY('K', 'E') /* keypad 2 */
381 #define K_K3 TERMCAP2KEY('K', 'F') /* keypad 3 */
382 #define K_K4 TERMCAP2KEY('K', 'G') /* keypad 4 */
383 #define K_K5 TERMCAP2KEY('K', 'H') /* keypad 5 */
384 #define K_K6 TERMCAP2KEY('K', 'I') /* keypad 6 */
385 #define K_K7 TERMCAP2KEY('K', 'J') /* keypad 7 */
386 #define K_K8 TERMCAP2KEY('K', 'K') /* keypad 8 */
387 #define K_K9 TERMCAP2KEY('K', 'L') /* keypad 9 */
388 
389 #define K_MOUSE TERMCAP2KEY(KS_MOUSE, KE_FILLER)
390 #define K_MENU TERMCAP2KEY(KS_MENU, KE_FILLER)
391 #define K_VER_SCROLLBAR TERMCAP2KEY(KS_VER_SCROLLBAR, KE_FILLER)
392 #define K_HOR_SCROLLBAR TERMCAP2KEY(KS_HOR_SCROLLBAR, KE_FILLER)
393 
394 #define K_SELECT TERMCAP2KEY(KS_SELECT, KE_FILLER)
395 
396 #define K_TABLINE TERMCAP2KEY(KS_TABLINE, KE_FILLER)
397 #define K_TABMENU TERMCAP2KEY(KS_TABMENU, KE_FILLER)
398 
399 /*
400  * Symbols for pseudo keys which are translated from the real key symbols
401  * above.
402  */
403 #define K_LEFTMOUSE TERMCAP2KEY(KS_EXTRA, KE_LEFTMOUSE)
404 #define K_LEFTMOUSE_NM TERMCAP2KEY(KS_EXTRA, KE_LEFTMOUSE_NM)
405 #define K_LEFTDRAG TERMCAP2KEY(KS_EXTRA, KE_LEFTDRAG)
406 #define K_LEFTRELEASE TERMCAP2KEY(KS_EXTRA, KE_LEFTRELEASE)
407 #define K_LEFTRELEASE_NM TERMCAP2KEY(KS_EXTRA, KE_LEFTRELEASE_NM)
408 #define K_MIDDLEMOUSE TERMCAP2KEY(KS_EXTRA, KE_MIDDLEMOUSE)
409 #define K_MIDDLEDRAG TERMCAP2KEY(KS_EXTRA, KE_MIDDLEDRAG)
410 #define K_MIDDLERELEASE TERMCAP2KEY(KS_EXTRA, KE_MIDDLERELEASE)
411 #define K_RIGHTMOUSE TERMCAP2KEY(KS_EXTRA, KE_RIGHTMOUSE)
412 #define K_RIGHTDRAG TERMCAP2KEY(KS_EXTRA, KE_RIGHTDRAG)
413 #define K_RIGHTRELEASE TERMCAP2KEY(KS_EXTRA, KE_RIGHTRELEASE)
414 #define K_X1MOUSE TERMCAP2KEY(KS_EXTRA, KE_X1MOUSE)
415 #define K_X1MOUSE TERMCAP2KEY(KS_EXTRA, KE_X1MOUSE)
416 #define K_X1DRAG TERMCAP2KEY(KS_EXTRA, KE_X1DRAG)
417 #define K_X1RELEASE TERMCAP2KEY(KS_EXTRA, KE_X1RELEASE)
418 #define K_X2MOUSE TERMCAP2KEY(KS_EXTRA, KE_X2MOUSE)
419 #define K_X2DRAG TERMCAP2KEY(KS_EXTRA, KE_X2DRAG)
420 #define K_X2RELEASE TERMCAP2KEY(KS_EXTRA, KE_X2RELEASE)
421 
422 #define K_IGNORE TERMCAP2KEY(KS_EXTRA, KE_IGNORE)
423 #define K_NOP TERMCAP2KEY(KS_EXTRA, KE_NOP)
424 
425 #define K_MOUSEDOWN TERMCAP2KEY(KS_EXTRA, KE_MOUSEDOWN)
426 #define K_MOUSEUP TERMCAP2KEY(KS_EXTRA, KE_MOUSEUP)
427 #define K_MOUSELEFT TERMCAP2KEY(KS_EXTRA, KE_MOUSELEFT)
428 #define K_MOUSERIGHT TERMCAP2KEY(KS_EXTRA, KE_MOUSERIGHT)
429 
430 #define K_CSI TERMCAP2KEY(KS_EXTRA, KE_CSI)
431 #define K_SNR TERMCAP2KEY(KS_EXTRA, KE_SNR)
432 #define K_PLUG TERMCAP2KEY(KS_EXTRA, KE_PLUG)
433 #define K_CMDWIN TERMCAP2KEY(KS_EXTRA, KE_CMDWIN)
434 
435 #define K_DROP TERMCAP2KEY(KS_EXTRA, KE_DROP)
436 
437 #define K_EVENT TERMCAP2KEY(KS_EXTRA, KE_EVENT)
438 #define K_PASTE TERMCAP2KEY(KS_EXTRA, KE_PASTE)
439 #define K_COMMAND TERMCAP2KEY(KS_EXTRA, KE_COMMAND)
440 
441 /* Bits for modifier mask */
442 /* 0x01 cannot be used, because the modifier must be 0x02 or higher */
443 #define MOD_MASK_SHIFT 0x02
444 #define MOD_MASK_CTRL 0x04
445 #define MOD_MASK_ALT 0x08 // aka META
446 #define MOD_MASK_META 0x10 // META when it's different from ALT
447 #define MOD_MASK_2CLICK 0x20 // use MOD_MASK_MULTI_CLICK
448 #define MOD_MASK_3CLICK 0x40 // use MOD_MASK_MULTI_CLICK
449 #define MOD_MASK_4CLICK 0x60 // use MOD_MASK_MULTI_CLICK
450 #define MOD_MASK_CMD 0x80 // "super" key (macOS: command-key)
451 
452 #define MOD_MASK_MULTI_CLICK (MOD_MASK_2CLICK|MOD_MASK_3CLICK| \
453  MOD_MASK_4CLICK)
454 
455 /*
456  * The length of the longest special key name, including modifiers.
457  * Current longest is <M-C-S-T-D-A-4-ScrollWheelRight> (length includes '<' and
458  * '>').
459  */
460 #define MAX_KEY_NAME_LEN 32
461 
462 // Maximum length of a special key event as tokens. This includes modifiers.
463 // The longest event is something like <M-C-S-T-4-LeftDrag> which would be the
464 // following string of tokens:
465 //
466 // <K_SPECIAL> <KS_MODIFIER> bitmask <K_SPECIAL> <KS_EXTRA> <KE_LEFTDRAG>.
467 //
468 // This is a total of 6 tokens, and is currently the longest one possible.
469 #define MAX_KEY_CODE_LEN 6
470 
471 #define FLAG_CPO_BSLASH 0x01
472 #define CPO_TO_CPO_FLAGS ((vim_strchr(p_cpo, CPO_BSLASH) == NULL) \
473  ? 0 \
474  : FLAG_CPO_BSLASH)
475 
476 #ifdef INCLUDE_GENERATED_DECLARATIONS
477 # include "keymap.h.generated.h"
478 #endif
479 #endif // NVIM_KEYMAP_H
Definition: keymap.h:182
Definition: keymap.h:242
Definition: keymap.h:230
Definition: keymap.h:198
Definition: keymap.h:197
Definition: keymap.h:128
Definition: keymap.h:137
Definition: keymap.h:145
Definition: keymap.h:201
Definition: keymap.h:243
Definition: keymap.h:216
Definition: keymap.h:196
Definition: keymap.h:144
Definition: keymap.h:157
Definition: keymap.h:134
Definition: keymap.h:169
Definition: keymap.h:248
Definition: keymap.h:204
Definition: keymap.h:235
Definition: keymap.h:237
Definition: keymap.h:228
Definition: keymap.h:208
Definition: keymap.h:167
Definition: keymap.h:164
Definition: keymap.h:199
Definition: keymap.h:143
Definition: keymap.h:148
Definition: keymap.h:188
Definition: keymap.h:160
Definition: keymap.h:152
Definition: keymap.h:125
Definition: keymap.h:175
Definition: keymap.h:224
Definition: keymap.h:220
Definition: keymap.h:191
Definition: keymap.h:139
Definition: keymap.h:207
Definition: keymap.h:229
Definition: keymap.h:168
Definition: keymap.h:250
Definition: keymap.h:163
Definition: keymap.h:179
Definition: keymap.h:149
Definition: keymap.h:236
Definition: keymap.h:158
Definition: keymap.h:146
Definition: keymap.h:156
Definition: keymap.h:155
Definition: keymap.h:217
key_extra
Definition: keymap.h:124
Definition: keymap.h:132
Definition: keymap.h:141
Definition: keymap.h:135
Definition: keymap.h:240
Definition: keymap.h:161
Definition: keymap.h:234
Definition: keymap.h:187
Definition: keymap.h:142
Definition: keymap.h:183
Definition: keymap.h:193
Definition: keymap.h:195
Definition: keymap.h:171
Definition: keymap.h:180
Definition: keymap.h:192
Definition: keymap.h:185
Definition: keymap.h:202
Definition: keymap.h:177
Definition: keymap.h:210
Definition: keymap.h:233
Definition: keymap.h:225
Definition: keymap.h:238
Definition: keymap.h:138
Definition: keymap.h:133
Definition: keymap.h:147
Definition: keymap.h:244
Definition: keymap.h:127
Definition: keymap.h:231
Definition: keymap.h:218
Definition: keymap.h:150
Definition: keymap.h:165
Definition: keymap.h:200
Definition: keymap.h:159
Definition: keymap.h:223
Definition: keymap.h:221
Definition: keymap.h:154
Definition: keymap.h:215
Definition: keymap.h:178
Definition: keymap.h:194
Definition: keymap.h:176
Definition: keymap.h:136
Definition: keymap.h:166
Definition: keymap.h:181
Definition: keymap.h:205
Definition: keymap.h:131
Definition: keymap.h:247
Definition: keymap.h:209
Definition: keymap.h:226
Definition: keymap.h:130
Definition: keymap.h:153