]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/qlkey.h
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / qlkey.h
1 // -*- C++ -*-
2 /**
3  * \file qlkey.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QLKEY_H
13 #define QLKEY_H
14
15 #include <Qt>
16 #include <string>
17
18
19 namespace lyx {
20
21
22 /**
23  * Return true if the key event is a modifier.
24  */
25 bool q_is_modifier(int qkey)
26 {
27         switch (qkey) {
28                 case Qt::Key_Hyper_L:
29                 case Qt::Key_Hyper_R:
30                 case Qt::Key_Super_L:
31                 case Qt::Key_Super_R:
32                 case Qt::Key_Shift:
33                 case Qt::Key_Control:
34                 case Qt::Key_Meta:
35                 case Qt::Key_Alt:
36                 case Qt::Key_AltGr:
37                         return true;
38         }
39         return false;
40 }
41
42
43 /**
44  * Return the numeric Qt Key corresponding to the
45  * given symbol name.
46  */
47 int string_to_qkey(std::string const & str)
48 {
49         // FIX! (Lgb)
50
51         if (str == "Escape") return Qt::Key_Escape;
52         if (str == "Tab") return Qt::Key_Tab;
53         if (str == "ISO_Left_Tab") return Qt::Key_Tab;
54         if (str == "BackSpace") return Qt::Key_Backspace;
55         if (str == "Return") return Qt::Key_Return;
56         if (str == "KP_Enter") return Qt::Key_Enter; // correct ?
57         if (str == "Insert") return Qt::Key_Insert;
58         if (str == "KP_Insert") return Qt::Key_Insert;
59         if (str == "Delete") return Qt::Key_Delete;
60         if (str == "KP_Delete") return Qt::Key_Delete;
61         if (str == "Pause") return Qt::Key_Pause;
62         if (str == "Print") return Qt::Key_Print;
63         if (str == "Sys_Req") return Qt::Key_SysReq;
64         if (str == "Home") return Qt::Key_Home;
65         if (str == "End") return Qt::Key_End;
66         if (str == "Left") return Qt::Key_Left;
67         if (str == "Up") return Qt::Key_Up;
68         if (str == "Right") return Qt::Key_Right;
69         if (str == "Down") return Qt::Key_Down;
70         if (str == "Prior") return Qt::Key_PageUp;
71         if (str == "Next") return Qt::Key_PageDown;
72         if (str == "KP_Home") return Qt::Key_Home;
73         if (str == "KP_End") return Qt::Key_End;
74         if (str == "KP_Left") return Qt::Key_Left;
75         if (str == "KP_Up") return Qt::Key_Up;
76         if (str == "KP_Right") return Qt::Key_Right;
77         if (str == "KP_Down") return Qt::Key_Down;
78         if (str == "KP_Prior") return Qt::Key_PageUp;
79         if (str == "KP_Next") return Qt::Key_PageDown;
80         if (str == "Shift_L") return Qt::Key_Shift;
81         if (str == "Control_L") return Qt::Key_Control;
82         if (str == "Alt_L") return Qt::Key_Meta; // correct ?
83         if (str == "Alt_R") return Qt::Key_Alt;
84         if (str == "Caps_Lock") return Qt::Key_CapsLock;
85         if (str == "Num_Lock") return Qt::Key_NumLock;
86         if (str == "Scroll_Lock") return Qt::Key_ScrollLock;
87         if (str == "F1") return Qt::Key_F1;
88         if (str == "F2") return Qt::Key_F2;
89         if (str == "F3") return Qt::Key_F3;
90         if (str == "F4") return Qt::Key_F4;
91         if (str == "F5") return Qt::Key_F5;
92         if (str == "F6") return Qt::Key_F6;
93         if (str == "F7") return Qt::Key_F7;
94         if (str == "F8") return Qt::Key_F8;
95         if (str == "F9") return Qt::Key_F9;
96         if (str == "F10") return Qt::Key_F10;
97         if (str == "F11") return Qt::Key_F11;
98         if (str == "F12") return Qt::Key_F12;
99         if (str == "F13") return Qt::Key_F13;
100         if (str == "F14") return Qt::Key_F14;
101         if (str == "F15") return Qt::Key_F15;
102         if (str == "F16") return Qt::Key_F16;
103         if (str == "F17") return Qt::Key_F17;
104         if (str == "F18") return Qt::Key_F18;
105         if (str == "F19") return Qt::Key_F19;
106         if (str == "F20") return Qt::Key_F20;
107         if (str == "F21") return Qt::Key_F21;
108         if (str == "F22") return Qt::Key_F22;
109         if (str == "F23") return Qt::Key_F23;
110         if (str == "F24") return Qt::Key_F24;
111         if (str == "F25") return Qt::Key_F25;
112         if (str == "F26") return Qt::Key_F26;
113         if (str == "F27") return Qt::Key_F27;
114         if (str == "F28") return Qt::Key_F28;
115         if (str == "F29") return Qt::Key_F29;
116         if (str == "F30") return Qt::Key_F30;
117         if (str == "F31") return Qt::Key_F31;
118         if (str == "F32") return Qt::Key_F32;
119         if (str == "F33") return Qt::Key_F33;
120         if (str == "F34") return Qt::Key_F34;
121         if (str == "F35") return Qt::Key_F35;
122         if (str == "0") return Qt::Key_0;
123         if (str == "1") return Qt::Key_1;
124         if (str == "2") return Qt::Key_2;
125         if (str == "3") return Qt::Key_3;
126         if (str == "4") return Qt::Key_4;
127         if (str == "5") return Qt::Key_5;
128         if (str == "6") return Qt::Key_6;
129         if (str == "7") return Qt::Key_7;
130         if (str == "8") return Qt::Key_8;
131         if (str == "9") return Qt::Key_9;
132         if (str == "KP_0") return Qt::Key_0;
133         if (str == "KP_1") return Qt::Key_1;
134         if (str == "KP_2") return Qt::Key_2;
135         if (str == "KP_3") return Qt::Key_3;
136         if (str == "KP_4") return Qt::Key_4;
137         if (str == "KP_5") return Qt::Key_5;
138         if (str == "KP_6") return Qt::Key_6;
139         if (str == "KP_7") return Qt::Key_7;
140         if (str == "KP_8") return Qt::Key_8;
141         if (str == "KP_9") return Qt::Key_9;
142         if (str == "colon") return Qt::Key_Colon;
143         if (str == "semicolon") return Qt::Key_Semicolon;
144         if (str == "less") return Qt::Key_Less;
145         if (str == "equal") return Qt::Key_Equal;
146         if (str == "greater") return Qt::Key_Greater;
147         if (str == "question") return Qt::Key_Question;
148         if (str == "at") return Qt::Key_At;
149         if (str == "A") return Qt::Key_A;
150         if (str == "B") return Qt::Key_B;
151         if (str == "C") return Qt::Key_C;
152         if (str == "D") return Qt::Key_D;
153         if (str == "E") return Qt::Key_E;
154         if (str == "F") return Qt::Key_F;
155         if (str == "G") return Qt::Key_G;
156         if (str == "H") return Qt::Key_H;
157         if (str == "I") return Qt::Key_I;
158         if (str == "J") return Qt::Key_J;
159         if (str == "K") return Qt::Key_K;
160         if (str == "L") return Qt::Key_L;
161         if (str == "M") return Qt::Key_M;
162         if (str == "N") return Qt::Key_N;
163         if (str == "O") return Qt::Key_O;
164         if (str == "P") return Qt::Key_P;
165         if (str == "Q") return Qt::Key_Q;
166         if (str == "R") return Qt::Key_R;
167         if (str == "S") return Qt::Key_S;
168         if (str == "T") return Qt::Key_T;
169         if (str == "U") return Qt::Key_U;
170         if (str == "V") return Qt::Key_V;
171         if (str == "W") return Qt::Key_W;
172         if (str == "X") return Qt::Key_X;
173         if (str == "Y") return Qt::Key_Y;
174         if (str == "Z") return Qt::Key_Z;
175         if (str == "a") return Qt::Key_A;
176         if (str == "b") return Qt::Key_B;
177         if (str == "c") return Qt::Key_C;
178         if (str == "d") return Qt::Key_D;
179         if (str == "e") return Qt::Key_E;
180         if (str == "f") return Qt::Key_F;
181         if (str == "g") return Qt::Key_G;
182         if (str == "h") return Qt::Key_H;
183         if (str == "i") return Qt::Key_I;
184         if (str == "j") return Qt::Key_J;
185         if (str == "k") return Qt::Key_K;
186         if (str == "l") return Qt::Key_L;
187         if (str == "m") return Qt::Key_M;
188         if (str == "n") return Qt::Key_N;
189         if (str == "o") return Qt::Key_O;
190         if (str == "p") return Qt::Key_P;
191         if (str == "q") return Qt::Key_Q;
192         if (str == "r") return Qt::Key_R;
193         if (str == "s") return Qt::Key_S;
194         if (str == "t") return Qt::Key_T;
195         if (str == "u") return Qt::Key_U;
196         if (str == "v") return Qt::Key_V;
197         if (str == "w") return Qt::Key_W;
198         if (str == "x") return Qt::Key_X;
199         if (str == "y") return Qt::Key_Y;
200         if (str == "z") return Qt::Key_Z;
201         if (str == "bracketleft") return Qt::Key_BracketLeft;
202         if (str == "backslash") return Qt::Key_Backslash;
203         if (str == "bracketright") return Qt::Key_BracketRight;
204         if (str == "bar") return Qt::Key_Bar;
205         if (str == "underscore") return Qt::Key_Underscore;
206         if (str == "space") return Qt::Key_Space;
207         if (str == "parenleft") return Qt::Key_ParenLeft;
208         if (str == "parenright") return Qt::Key_ParenRight;
209         if (str == "quotedbl") return Qt::Key_QuoteDbl;
210         if (str == "quoteright") return Qt::Key_Apostrophe;
211         if (str == "quoteleft") return Qt::Key_QuoteLeft;
212         if (str == "exclam") return Qt::Key_Exclam;
213         if (str == "numbersign") return Qt::Key_NumberSign;
214         if (str == "asciicircum") return Qt::Key_AsciiCircum;
215         if (str == "dollar") return Qt::Key_Dollar;
216         if (str == "percent") return Qt::Key_Percent;
217         if (str == "ampersand") return Qt::Key_Ampersand;
218         if (str == "asterisk") return Qt::Key_Asterisk;
219         if (str == "KP_Multiply") return Qt::Key_Asterisk;
220         if (str == "apostrophe") return Qt::Key_Apostrophe;
221         if (str == "plus") return Qt::Key_Plus;
222         if (str == "KP_Add") return Qt::Key_Plus;
223         if (str == "minus") return Qt::Key_Minus;
224         if (str == "KP_Subtract") return Qt::Key_Minus;
225         if (str == "comma") return Qt::Key_Comma;
226         if (str == "period") return Qt::Key_Period;
227         if (str == "KP_Decimal") return Qt::Key_Period;
228         if (str == "slash") return Qt::Key_Slash;
229         if (str == "KP_Divide") return Qt::Key_Slash;
230         if (str == "asciitilde") return Qt::Key_AsciiTilde;
231         if (str == "braceleft") return Qt::Key_BraceLeft;
232         if (str == "braceright") return Qt::Key_BraceRight;
233         if (str == "grave") return Qt::Key_QuoteLeft; // ???
234         if (str == "notsign") return Qt::Key_notsign;
235         if (str == "nobreakspace") return Qt::Key_nobreakspace;
236         if (str == "exclamdown") return Qt::Key_exclamdown;
237         if (str == "cent") return Qt::Key_cent;
238         if (str == "sterling") return Qt::Key_sterling;
239         if (str == "currency") return Qt::Key_currency;
240         if (str == "yen") return Qt::Key_yen;
241         if (str == "brokenbar") return Qt::Key_brokenbar;
242         if (str == "section") return Qt::Key_section;
243         if (str == "diaeresis") return Qt::Key_diaeresis;
244         if (str == "copyright") return Qt::Key_copyright;
245         if (str == "ordfeminine") return Qt::Key_ordfeminine;
246         if (str == "guillemotleft") return Qt::Key_guillemotleft;
247         if (str == "hyphen") return Qt::Key_hyphen;
248         if (str == "registered") return Qt::Key_registered;
249         if (str == "macron") return Qt::Key_macron;
250         if (str == "degree") return Qt::Key_degree;
251         if (str == "plusminus") return Qt::Key_plusminus;
252         if (str == "twosuperior") return Qt::Key_twosuperior;
253         if (str == "threesuperior") return Qt::Key_threesuperior;
254         if (str == "acute") return Qt::Key_acute;
255         if (str == "mu") return Qt::Key_mu;
256         if (str == "paragraph") return Qt::Key_paragraph;
257         if (str == "periodcentered") return Qt::Key_periodcentered;
258         if (str == "cedilla") return Qt::Key_cedilla;
259         if (str == "onesuperior") return Qt::Key_onesuperior;
260         if (str == "masculine") return Qt::Key_masculine;
261         if (str == "guillemotright") return Qt::Key_guillemotright;
262         if (str == "onequarter") return Qt::Key_onequarter;
263         if (str == "onehalf") return Qt::Key_onehalf;
264         if (str == "threequarters") return Qt::Key_threequarters;
265         if (str == "questiondown") return Qt::Key_questiondown;
266         if (str == "Agrave") return Qt::Key_Agrave;
267         if (str == "Aacute") return Qt::Key_Aacute;
268         if (str == "Acircumflex") return Qt::Key_Acircumflex;
269         if (str == "Atilde") return Qt::Key_Atilde;
270         if (str == "Adiaeresis") return Qt::Key_Adiaeresis;
271         if (str == "Aring") return Qt::Key_Aring;
272         if (str == "AE") return Qt::Key_AE;
273         if (str == "Ccedilla") return Qt::Key_Ccedilla;
274         if (str == "Egrave") return Qt::Key_Egrave;
275         if (str == "Eacute") return Qt::Key_Eacute;
276         if (str == "Ecircumflex") return Qt::Key_Ecircumflex;
277         if (str == "Ediaeresis") return Qt::Key_Ediaeresis;
278         if (str == "Igrave") return Qt::Key_Igrave;
279         if (str == "Iacute") return Qt::Key_Iacute;
280         if (str == "Icircumflex") return Qt::Key_Icircumflex;
281         if (str == "Idiaeresis") return Qt::Key_Idiaeresis;
282         if (str == "ETH") return Qt::Key_ETH;
283         if (str == "Ntilde") return Qt::Key_Ntilde;
284         if (str == "Ograve") return Qt::Key_Ograve;
285         if (str == "Oacute") return Qt::Key_Oacute;
286         if (str == "Ocircumflex") return Qt::Key_Ocircumflex;
287         if (str == "Otilde") return Qt::Key_Otilde;
288         if (str == "Odiaeresis") return Qt::Key_Odiaeresis;
289         if (str == "multiply") return Qt::Key_multiply;
290         if (str == "Ooblique") return Qt::Key_Ooblique;
291         if (str == "Ugrave") return Qt::Key_Ugrave;
292         if (str == "Uacute") return Qt::Key_Uacute;
293         if (str == "Ucircumflex") return Qt::Key_Ucircumflex;
294         if (str == "Udiaeresis") return Qt::Key_Udiaeresis;
295         if (str == "Yacute") return Qt::Key_Yacute;
296         if (str == "THORN") return Qt::Key_THORN;
297         if (str == "ssharp") return Qt::Key_ssharp;
298         if (str == "agrave") return Qt::Key_Agrave;
299         if (str == "aacute") return Qt::Key_Aacute;
300         if (str == "acircumflex") return Qt::Key_Acircumflex;
301         if (str == "atilde") return Qt::Key_Atilde;
302         if (str == "adiaeresis") return Qt::Key_Adiaeresis;
303         if (str == "aring") return Qt::Key_Aring;
304         if (str == "ae") return Qt::Key_AE;
305         if (str == "ccedilla") return Qt::Key_Ccedilla;
306         if (str == "egrave") return Qt::Key_Egrave;
307         if (str == "eacute") return Qt::Key_Eacute;
308         if (str == "ecircumflex") return Qt::Key_Ecircumflex;
309         if (str == "ediaeresis") return Qt::Key_Ediaeresis;
310         if (str == "igrave") return Qt::Key_Igrave;
311         if (str == "iacute") return Qt::Key_Iacute;
312         if (str == "icircumflex") return Qt::Key_Icircumflex;
313         if (str == "idiaeresis") return Qt::Key_Idiaeresis;
314         if (str == "eth") return Qt::Key_ETH;
315         if (str == "ntilde") return Qt::Key_Ntilde;
316         if (str == "ograve") return Qt::Key_Ograve;
317         if (str == "oacute") return Qt::Key_Oacute;
318         if (str == "ocircumflex") return Qt::Key_Ocircumflex;
319         if (str == "otilde") return Qt::Key_Otilde;
320         if (str == "odiaeresis") return Qt::Key_Odiaeresis;
321         if (str == "division") return Qt::Key_division;
322         if (str == "oslash") return Qt::Key_Ooblique;
323         if (str == "ugrave") return Qt::Key_Ugrave;
324         if (str == "uacute") return Qt::Key_Uacute;
325         if (str == "ucircumflex") return Qt::Key_Ucircumflex;
326         if (str == "udiaeresis") return Qt::Key_Udiaeresis;
327         if (str == "yacute") return Qt::Key_Yacute;
328         if (str == "thorn") return Qt::Key_THORN;
329         if (str == "ydiaeresis") return Qt::Key_ydiaeresis;
330
331         // FIXME, correct for all these ?
332         if (str == "Super_L") return Qt::Key_Super_L;
333         if (str == "Super_R") return Qt::Key_Super_R;
334         if (str == "Menu") return Qt::Key_Menu;
335         if (str == "Hyper_L") return Qt::Key_Hyper_L;
336         if (str == "Hyper_R") return Qt::Key_Hyper_R;
337         if (str == "Help") return Qt::Key_Help;
338         if (str == "BackTab") return Qt::Key_Backtab;
339
340         return Qt::Key_unknown;
341 }
342
343
344 /**
345  * qkey_to_string - convert Qt keypress into LyX
346  *
347  * Convert the Qt keypress into a string understandable
348  * by the LyX core (same as XKeysymToString).
349  */
350 std::string const qkey_to_string(int lkey)
351 {
352         switch (lkey) {
353         case Qt::Key_0: return "0";
354         case Qt::Key_1: return "1";
355         case Qt::Key_2: return "2";
356         case Qt::Key_3: return "3";
357         case Qt::Key_4: return "4";
358         case Qt::Key_5: return "5";
359         case Qt::Key_6: return "6";
360         case Qt::Key_7: return "7";
361         case Qt::Key_8: return "8";
362         case Qt::Key_9: return "9";
363
364         case Qt::Key_A: return "a";
365         case Qt::Key_B: return "b";
366         case Qt::Key_C: return "c";
367         case Qt::Key_D: return "d";
368         case Qt::Key_E: return "e";
369         case Qt::Key_F: return "f";
370         case Qt::Key_G: return "g";
371         case Qt::Key_H: return "h";
372         case Qt::Key_I: return "i";
373         case Qt::Key_J: return "j";
374         case Qt::Key_K: return "k";
375         case Qt::Key_L: return "l";
376         case Qt::Key_M: return "m";
377         case Qt::Key_N: return "n";
378         case Qt::Key_O: return "o";
379         case Qt::Key_P: return "p";
380         case Qt::Key_Q: return "q";
381         case Qt::Key_R: return "r";
382         case Qt::Key_S: return "s";
383         case Qt::Key_T: return "t";
384         case Qt::Key_U: return "u";
385         case Qt::Key_V: return "v";
386         case Qt::Key_W: return "w";
387         case Qt::Key_X: return "x";
388         case Qt::Key_Y: return "y";
389         case Qt::Key_Z: return "z";
390
391         case Qt::Key_Escape: return "Escape";
392         case Qt::Key_Backspace: return "BackSpace";
393         case Qt::Key_Insert: return "Insert";
394         case Qt::Key_Delete: return "Delete";
395         case Qt::Key_Pause: return "Pause";
396         case Qt::Key_Print: return "Print";
397         case Qt::Key_SysReq: return "Sys_Req";
398         case Qt::Key_Home: return "Home";
399         case Qt::Key_End: return "End";
400         case Qt::Key_Left: return "Left";
401         case Qt::Key_Up: return "Up";
402         case Qt::Key_Right: return "Right";
403         case Qt::Key_Down: return "Down";
404         case Qt::Key_PageUp: return "Prior";
405         case Qt::Key_PageDown: return "Next";
406         case Qt::Key_Shift: return "Shift_L";
407         case Qt::Key_Control: return "Control_L";
408         case Qt::Key_Meta: return "Alt_L"; // correct ?
409         case Qt::Key_Alt: return "Alt_R";
410         case Qt::Key_CapsLock: return "Caps_Lock";
411         case Qt::Key_NumLock: return "Num_Lock";
412         case Qt::Key_ScrollLock: return "Scroll_Lock";
413         case Qt::Key_F1: return "F1";
414         case Qt::Key_F2: return "F2";
415         case Qt::Key_F3: return "F3";
416         case Qt::Key_F4: return "F4";
417         case Qt::Key_F5: return "F5";
418         case Qt::Key_F6: return "F6";
419         case Qt::Key_F7: return "F7";
420         case Qt::Key_F8: return "F8";
421         case Qt::Key_F9: return "F9";
422         case Qt::Key_F10: return "F10";
423         case Qt::Key_F11: return "F11";
424         case Qt::Key_F12: return "F12";
425         case Qt::Key_F13: return "F13";
426         case Qt::Key_F14: return "F14";
427         case Qt::Key_F15: return "F15";
428         case Qt::Key_F16: return "F16";
429         case Qt::Key_F17: return "F17";
430         case Qt::Key_F18: return "F18";
431         case Qt::Key_F19: return "F19";
432         case Qt::Key_F20: return "F20";
433         case Qt::Key_F21: return "F21";
434         case Qt::Key_F22: return "F22";
435         case Qt::Key_F23: return "F23";
436         case Qt::Key_F24: return "F24";
437         case Qt::Key_F25: return "F25";
438         case Qt::Key_F26: return "F26";
439         case Qt::Key_F27: return "F27";
440         case Qt::Key_F28: return "F28";
441         case Qt::Key_F29: return "F29";
442         case Qt::Key_F30: return "F30";
443         case Qt::Key_F31: return "F31";
444         case Qt::Key_F32: return "F32";
445         case Qt::Key_F33: return "F33";
446         case Qt::Key_F34: return "F34";
447         case Qt::Key_F35: return "F35";
448         case Qt::Key_Colon: return "colon";
449         case Qt::Key_Semicolon: return "semicolon";
450         case Qt::Key_Less: return "less";
451         case Qt::Key_Equal: return "equal";
452         case Qt::Key_Greater: return "greater";
453         case Qt::Key_Question: return "question";
454         case Qt::Key_At: return "at";
455         case Qt::Key_BracketLeft: return "bracketleft";
456         case Qt::Key_Backslash: return "backslash";
457         case Qt::Key_BracketRight: return "bracketright";
458         case Qt::Key_Underscore: return "underscore";
459         case Qt::Key_Space: return "space";
460         case Qt::Key_ParenLeft: return "parenleft";
461         case Qt::Key_ParenRight: return "parenright";
462         case Qt::Key_QuoteDbl: return "quotedbl";
463         case Qt::Key_Exclam: return "exclam";
464         case Qt::Key_NumberSign: return "numbersign";
465         case Qt::Key_AsciiCircum: return "asciicircum";
466         case Qt::Key_Dollar: return "dollar";
467         case Qt::Key_Percent: return "percent";
468         case Qt::Key_Ampersand: return "ampersand";
469         case Qt::Key_Asterisk: return "asterisk";
470         case Qt::Key_Apostrophe: return "apostrophe";
471         case Qt::Key_Plus: return "plus";
472         case Qt::Key_Minus: return "minus";
473         case Qt::Key_Comma: return "comma";
474         case Qt::Key_Period: return "period";
475         case Qt::Key_Slash: return "slash";
476         case Qt::Key_AsciiTilde: return "asciitilde";
477         case Qt::Key_BraceLeft: return "braceleft";
478         case Qt::Key_BraceRight: return "braceright";
479         case Qt::Key_QuoteLeft: return "grave"; // ???
480         case Qt::Key_notsign: return "notsign";
481         case Qt::Key_nobreakspace: return "nobreakspace";
482         case Qt::Key_exclamdown: return "exclamdown";
483         case Qt::Key_cent: return "cent";
484         case Qt::Key_sterling: return "sterling";
485         case Qt::Key_currency: return "currency";
486         case Qt::Key_yen: return "yen";
487         case Qt::Key_brokenbar: return "brokenbar";
488         case Qt::Key_section: return "section";
489         case Qt::Key_diaeresis: return "diaeresis";
490         case Qt::Key_copyright: return "copyright";
491         case Qt::Key_ordfeminine: return "ordfeminine";
492         case Qt::Key_guillemotleft: return "guillemotleft";
493         case Qt::Key_hyphen: return "hyphen";
494         case Qt::Key_registered: return "registered";
495         case Qt::Key_macron: return "macron";
496         case Qt::Key_degree: return "degree";
497         case Qt::Key_plusminus: return "plusminus";
498         case Qt::Key_twosuperior: return "twosuperior";
499         case Qt::Key_threesuperior: return "threesuperior";
500         case Qt::Key_acute: return "acute";
501         case Qt::Key_mu: return "mu";
502         case Qt::Key_paragraph: return "paragraph";
503         case Qt::Key_periodcentered: return "periodcentered";
504         case Qt::Key_cedilla: return "cedilla";
505         case Qt::Key_onesuperior: return "onesuperior";
506         case Qt::Key_masculine: return "masculine";
507         case Qt::Key_guillemotright: return "guillemotright";
508         case Qt::Key_onequarter: return "onequarter";
509         case Qt::Key_onehalf: return "onehalf";
510         case Qt::Key_threequarters: return "threequarters";
511         case Qt::Key_questiondown: return "questiondown";
512         case Qt::Key_Agrave: return "Agrave";
513         case Qt::Key_Aacute: return "Aacute";
514         case Qt::Key_Acircumflex: return "Acircumflex";
515         case Qt::Key_Atilde: return "Atilde";
516         case Qt::Key_Adiaeresis: return "Adiaeresis";
517         case Qt::Key_Aring: return "Aring";
518         case Qt::Key_AE: return "AE";
519         case Qt::Key_Ccedilla: return "Ccedilla";
520         case Qt::Key_Egrave: return "Egrave";
521         case Qt::Key_Eacute: return "Eacute";
522         case Qt::Key_Ecircumflex: return "Ecircumflex";
523         case Qt::Key_Ediaeresis: return "Ediaeresis";
524         case Qt::Key_Igrave: return "Igrave";
525         case Qt::Key_Iacute: return "Iacute";
526         case Qt::Key_Icircumflex: return "Icircumflex";
527         case Qt::Key_Idiaeresis: return "Idiaeresis";
528         case Qt::Key_ETH: return "ETH";
529         case Qt::Key_Ntilde: return "Ntilde";
530         case Qt::Key_Ograve: return "Ograve";
531         case Qt::Key_Oacute: return "Oacute";
532         case Qt::Key_Ocircumflex: return "Ocircumflex";
533         case Qt::Key_Otilde: return "Otilde";
534         case Qt::Key_Odiaeresis: return "Odiaeresis";
535         case Qt::Key_multiply: return "multiply";
536         case Qt::Key_Ooblique: return "Ooblique";
537         case Qt::Key_Ugrave: return "Ugrave";
538         case Qt::Key_Uacute: return "Uacute";
539         case Qt::Key_Ucircumflex: return "Ucircumflex";
540         case Qt::Key_Udiaeresis: return "Udiaeresis";
541         case Qt::Key_Yacute: return "Yacute";
542         case Qt::Key_THORN: return "THORN";
543         case Qt::Key_ssharp: return "ssharp";
544         case Qt::Key_ydiaeresis: return "ydiaeresis";
545
546         // FIXME: these ones I don't know the names of ... help !
547         // what's here is basically guesses ...
548         case Qt::Key_Super_L: return "Super_L";
549         case Qt::Key_Super_R: return "Super_R";
550         case Qt::Key_Menu: return "Menu";
551         case Qt::Key_Hyper_L: return "Hyper_L";
552         case Qt::Key_Hyper_R: return "Hyper_R";
553         case Qt::Key_Help: return "Help";
554         case Qt::Key_Bar: return "Bar";
555         case Qt::Key_Backtab: return "BackTab";
556
557         default:
558         case Qt::Key_unknown: return "";
559         }
560 }
561
562
563 } // namespace lyx
564
565 #endif // QLKEY_H