2 * Copyright 2008 Red Hat Inc., Durham, North Carolina.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * Miloslav Trmač <mitr@redhat.com>
23 /* Longest sequences should go first, but these are comparatively common. */
26 E("\x03", "^C") // Or "cancel" (3 terms)
31 E("\x08", "backspace")
49 E("\x1A", "^Z") // Or "suspend" (9 terms)
50 /* \x1B handled only after all other escape sequences */
51 E("\x7F", "backspace") // 59 terms; alternative: "delete" (11 terms)
53 // Based on terminal descriptions in ncrses-base-5.6-20.20080927.fc10.
54 // Conflicts are marked by comments. Ordering: longest sequences first, then
56 E("\x1B[11;2~", "F13")
57 E("\x1B[11;3~", "F49")
58 E("\x1B[11;4~", "F61")
59 E("\x1B[11;5~", "F25")
60 E("\x1B[11;6~", "F37")
61 E("\x1B[12;2~", "F14")
62 E("\x1B[12;3~", "F50")
63 E("\x1B[12;4~", "F62")
64 E("\x1B[12;5~", "F26")
65 E("\x1B[12;6~", "F38")
66 E("\x1B[13;2~", "F15")
67 E("\x1B[13;3~", "F51")
68 E("\x1B[13;4~", "F63")
69 E("\x1B[13;5~", "F27")
70 E("\x1B[13;6~", "F39")
71 E("\x1B[14;2~", "F16")
72 E("\x1B[14;3~", "F52")
73 E("\x1B[14;5~", "F28")
74 E("\x1B[14;6~", "F40")
75 E("\x1B[15;2~", "F17")
76 E("\x1B[15;3~", "F53")
77 E("\x1B[15;5~", "F29")
78 E("\x1B[15;6~", "F41")
79 E("\x1B[17;2~", "F18")
80 E("\x1B[17;3~", "F54")
81 E("\x1B[17;5~", "F30")
82 E("\x1B[17;6~", "F42")
83 E("\x1B[18;2~", "F19")
84 E("\x1B[18;3~", "F55")
85 E("\x1B[18;5~", "F31")
86 E("\x1B[18;6~", "F43")
87 E("\x1B[19;2~", "F20")
88 E("\x1B[19;3~", "F56")
89 E("\x1B[19;5~", "F32")
90 E("\x1B[19;6~", "F44")
91 E("\x1B[20;2~", "F21")
92 E("\x1B[20;3~", "F57")
93 E("\x1B[20;5~", "F33")
94 E("\x1B[20;6~", "F45")
95 E("\x1B[21;2~", "F22")
96 E("\x1B[21;3~", "F58")
97 E("\x1B[21;5~", "F34")
98 E("\x1B[21;6~", "F46")
99 E("\x1B[23;2~", "F23")
100 E("\x1B[23;3~", "F59")
101 E("\x1B[23;5~", "F35")
102 E("\x1B[23;6~", "F47")
103 E("\x1B[24;2~", "F24")
104 E("\x1B[24;3~", "F60")
105 E("\x1B[24;5~", "F36")
106 E("\x1B[24;6~", "F48")
107 E("\x1B""O1;2A", "scroll-backward")
108 E("\x1B""O1;2B", "scroll-forward")
109 E("\x1B""O1;2C", "shift-right")
110 E("\x1B""O1;2D", "shift-left")
111 E("\x1B[192z", "F11")
112 E("\x1B[193z", "resume") // 3 terms; alternative "F12" (1 term)
113 E("\x1B[194z", "options") // 3 terms; alternative "F13" (1 term)
114 E("\x1B[195z", "undo") // 4 terms; alternative "F14" (1 term)
115 E("\x1B[196z", "help") // 1 term; alternative "F15" (1 term)
116 E("\x1B[197z", "copy")
117 E("\x1B[198z", "F17")
118 E("\x1B[199z", "F18")
119 E("\x1B[1;2A", "scroll-backward")
120 E("\x1B[1;2B", "scroll-forward")
121 E("\x1B[1;2C", "shift-right")
122 E("\x1B[1;2D", "shift-left")
123 E("\x1B[1;2F", "shift-end")
124 E("\x1B[1;2H", "shift-home")
125 E("\x1B[200z", "find") // 1 term; alternative "F19" (1 term)
126 E("\x1B[201z", "F20")
127 E("\x1B[208z", "F31")
128 E("\x1B[209z", "F32")
129 E("\x1B[210z", "F33")
130 E("\x1B[211z", "F34")
131 E("\x1B[212z", "F35")
132 E("\x1B[213z", "F36")
133 E("\x1B[214z", "home")
134 E("\x1B[215z", "F38")
135 E("\x1B[216z", "page-up")
136 E("\x1B[217z", "F40")
138 E("\x1B[219z", "F42")
139 E("\x1B[220z", "end")
140 E("\x1B[221z", "F44")
141 E("\x1B[222z", "page-down") // 4 terms; alternative "F45" (1 term)
151 E("\x1B[233z", "F10")
152 E("\x1B[234z", "F11") // 3 terms; alternative "F46" (1 term)
153 E("\x1B[235z", "F12") // 3 terms; alternative "F47" (1 term)
154 E("\x1B[2;2~", "shift-insert")
155 E("\x1B[2;5~", "shift-insert")
156 E("\x1B[3;2~", "shift-del")
157 E("\x1B[3;5~", "shift-del")
158 E("\x1B[5;2~", "shift-previous")
159 E("\x1B[5;5~", "shift-previous")
160 E("\x1B[6;2~", "shift-next")
161 E("\x1B[6;5~", "shift-next")
181 E("\x1B[21~", "F10") // 85 terms; alternative "F0" (9 terms)
195 E("\x1B[28~", "F15") // 42 terms; alternative "help" (8 terms)
197 E("\x1B[29~", "F16") // 42 terms; alternative "redo" (4 terms)
198 E("\x1B[30~", "insert-line")
200 E("\x1B[31~", "F17") // 46 terms; alternative "delete-line" (1 term)
207 E("\x1B""O2A", "scroll-backward")
208 E("\x1B""O2B", "scroll-forward")
209 E("\x1B""O2C", "shift-right")
210 E("\x1B""O2D", "shift-left")
211 E("\x1B""O2P", "F13")
212 E("\x1B""O2Q", "F14")
213 E("\x1B""O2R", "F15")
214 E("\x1B""O2S", "F16")
215 E("\x1B""O3P", "F49")
216 E("\x1B""O3Q", "F50")
217 E("\x1B""O3R", "F51")
218 E("\x1B""O3S", "F52")
219 E("\x1B""O4P", "F61")
220 E("\x1B""O4Q", "F62")
221 E("\x1B""O4R", "F63")
222 E("\x1B""O5C", "shift-right")
223 E("\x1B""O5D", "shift-left")
224 E("\x1B""O5F", "shift-end")
225 E("\x1B""O5H", "shift-home")
226 E("\x1B""O5P", "F25")
227 E("\x1B""O5Q", "F26")
228 E("\x1B""O5R", "F27")
229 E("\x1B""O5S", "F28")
230 E("\x1B""O6P", "F37")
231 E("\x1B""O6Q", "F38")
232 E("\x1B""O6R", "F39")
233 E("\x1B""O6S", "F40")
234 E("\x1B[1~", "home") // 30 terms; alternative "find" (42 terms, but "home" is used in Linux)
235 E("\x1B[2$", "shift-insert")
236 E("\x1B[2z", "insert")
237 E("\x1B[2~", "insert")
238 E("\x1B[3$", "shift-del")
239 E("\x1B[3z", "delete")
240 E("\x1B[3~", "delete")
241 E("\x1B[4~", "end") // 30 terms; alternative "select" (42 terms, but "end" is used in Linux)
242 E("\x1B[5$", "shift-previous")
243 E("\x1B[5~", "page-up") // 86 terms; alternative "A3" (4 terms)
244 E("\x1B[6$", "shift-next")
245 E("\x1B[6~", "page-down") // 86 terms; alternative "C3" (4 terms)
246 E("\x1B[7$", "shift-home")
247 E("\x1B[7~", "home") // 17 terms; alternative "A1" (4 terms)
248 E("\x1B[8$", "shift-end")
249 E("\x1B[8^", "delete-eol")
250 E("\x1B[8~", "end") // 17 terms; alternatives "C1" (4 terms), "delete-eol" (1 term)
251 E("\x1B[>M", "mouse")
266 E("\x9B""21~", "F10")
267 E("\x9B""23~", "F11")
268 E("\x9B""24~", "F12")
269 E("\x9B""25~", "F13")
270 E("\x9B""26~", "F14")
271 E("\x9B""28~", "F15")
272 E("\x9B""29~", "F16")
273 E("\x9B""31~", "F17")
274 E("\x9B""32~", "F18")
275 E("\x9B""33~", "F19")
276 E("\x9B""34~", "F20")
277 E("\x1B""2$", "shift-insert")
279 E("\x1B""OB", "down")
280 E("\x1B""OC", "right")
281 E("\x1B""OD", "left")
282 E("\x1B""OE", "B2") // 16 terms; alternative "begin" (5 terms)
284 E("\x1B""OH", "home")
285 E("\x1B""OM", "send")
301 E("\x1B""Oq", "C1") // 17 terms; alternatives "A1" (5 terms), "F0" (1 term)
303 E("\x1B""Os", "C3") // 17 terms; alternative "A3" (7 terms)
305 E("\x1B""Ou", "B2") // 21 terms; alternative "F6" (4 terms), "begin" (4 terms)
307 E("\x1B""Ow", "A1") // 17 terms; alternative "F9" (4 terms)
309 E("\x1B""Oy", "A3") // 17 terms; alternative "F0" (5 terms)
310 E("\x1B[9", "delete")
311 E("\x1B[@", "F41") // 4 terms; alternative "insert" (3 terms)
316 E("\x1B[E", "B2") // 9 terms; alternative "begin" (1 term)
317 E("\x1B[F", "end") // 5 terms; alternative "lower-left" (3 terms)
318 E("\x1B[G", "B2") // 9 terms; alternative "page-down" (4 terms)
320 E("\x1B[I", "page-up")
321 E("\x1B[L", "insert")
322 E("\x1B[M", "mouse") // 83 terms; alternative "F1" (4 terms)
330 E("\x1B[U", "F9") // 4 terms; alternative "page-down" (3 terms)
331 E("\x1B[V", "F10") // 4 terms; alternative "page-dup" (3 terms)
334 E("\x1B[Y", "F13") // 4 terms; alternative "end" (3 terms)
335 E("\x1B[Z", "back-tab") // 59 terms; alternative "F14" (4 terms)
344 E("\x1B[c", "shift-right") // 15 terms; alternative "F17" (4 terms)
345 E("\x1B[d", "shift-left") // 15 terms; alternative "F18" (4 terms)
369 E("\x9B""1~", "home")
370 E("\x9B""2~", "insert")
371 E("\x9B""3~", "delete")
373 E("\x9B""5~", "page-up")
374 E("\x9B""6~", "page-down")
377 E("\x1B""C", "right")
380 E("\x1B""J", "clear")
381 E("\x1B""P", "delete")
382 E("\x1B""Q", "insert")
383 E("\x1B""S", "page-down")
384 E("\x1B""T", "page-up")
394 E("\x1B\x09", "back-tab")
397 E("\x8F""C", "right")
399 E("\x8F""E", "begin")
406 E("\x9B""M", "mouse")
407 E("\x9B""Z", "back-tab")