>>>>> "John" == John Levon <[EMAIL PROTECTED]> writes:
John> On Fri, Nov 22, 2002 at 10:47:54AM +0100, Jean-Marc Lasgouttes John> wrote: >> You should add an error message at the end of qkey_to_string and >> string_to_qkey to find the missng entries and both should rely on a >> common table John> No, can't work. What do you mean? The attached patch adds an error message to string_to_qkey and fixes a number of errors found using it. It is probably not a good idea to use it as is. >> (string,int) in order to avoid mistakes. John> That neither. Believe me, this stuff is REALLY fubar. And there John> is nothing we can do about it. Give me one good reason why a common table cannot be used in both functions? John> Simple fact is, for Herbert's/Juergen's keys to work, we have to John> match : John> (Qt::Key_unknown/"Ä") against (Qt::Key_Adiaresis/"Adiaresis") Yes, but this is not the problem I am trying to solve. My problem is in the inaccuracy of the symbols that we are already supposed to handle :) JMarc
Index: src/frontends/qt2/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v retrieving revision 1.318 diff -u -p -r1.318 ChangeLog --- src/frontends/qt2/ChangeLog 25 Nov 2002 03:18:27 -0000 1.318 +++ src/frontends/qt2/ChangeLog 25 Nov 2002 11:36:08 -0000 @@ -1,3 +1,8 @@ +2002-11-25 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * qlkey.h (string_to_qkey): print a debug message when a key is + unknown. Add many missing entries + 2002-11-25 John Levon <[EMAIL PROTECTED]> * qscreen.C: use LColor::cursor properly Index: src/frontends/qt2/qlkey.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qlkey.h,v retrieving revision 1.14 diff -u -p -r1.14 qlkey.h --- src/frontends/qt2/qlkey.h 20 Nov 2002 16:46:17 -0000 1.14 +++ src/frontends/qt2/qlkey.h 25 Nov 2002 11:36:08 -0000 @@ -18,6 +18,8 @@ #include <qnamespace.h> #include "LString.h" +#include "debug.h" + /** * Return true if the key event is a modifier. @@ -53,6 +55,7 @@ int string_to_qkey(string const & str) if (str == "Escape") return Qt::Key_Escape; if (str == "Tab") return Qt::Key_Tab; + if (str == "ISO_Left_Tab") return Qt::Key_Tab; if (str == "BackSpace") return Qt::Key_BackSpace; if (str == "Return") return Qt::Key_Return; if (str == "KP_Enter") return Qt::Key_Enter; // correct ? @@ -131,6 +134,16 @@ int string_to_qkey(string const & str) if (str == "7") return Qt::Key_7; if (str == "8") return Qt::Key_8; if (str == "9") return Qt::Key_9; + if (str == "KP_0") return Qt::Key_0; + if (str == "KP_1") return Qt::Key_1; + if (str == "KP_2") return Qt::Key_2; + if (str == "KP_3") return Qt::Key_3; + if (str == "KP_4") return Qt::Key_4; + if (str == "KP_5") return Qt::Key_5; + if (str == "KP_6") return Qt::Key_6; + if (str == "KP_7") return Qt::Key_7; + if (str == "KP_8") return Qt::Key_8; + if (str == "KP_9") return Qt::Key_9; if (str == "colon") return Qt::Key_Colon; if (str == "semicolon") return Qt::Key_Semicolon; if (str == "less") return Qt::Key_Less; @@ -193,11 +206,14 @@ int string_to_qkey(string const & str) if (str == "bracketleft") return Qt::Key_BracketLeft; if (str == "backslash") return Qt::Key_Backslash; if (str == "bracketright") return Qt::Key_BracketRight; + if (str == "bar") return Qt::Key_Bar; if (str == "underscore") return Qt::Key_Underscore; if (str == "space") return Qt::Key_Space; if (str == "parenleft") return Qt::Key_ParenLeft; if (str == "parenright") return Qt::Key_ParenRight; if (str == "quotedbl") return Qt::Key_QuoteDbl; + if (str == "quoteright") return Qt::Key_Apostrophe; + if (str == "quoteleft") return Qt::Key_QuoteLeft; if (str == "exclam") return Qt::Key_Exclam; if (str == "numbersign") return Qt::Key_NumberSign; if (str == "asciicircum") return Qt::Key_AsciiCircum; @@ -205,12 +221,17 @@ int string_to_qkey(string const & str) if (str == "percent") return Qt::Key_Percent; if (str == "ampersand") return Qt::Key_Ampersand; if (str == "asterisk") return Qt::Key_Asterisk; + if (str == "KP_Multiply") return Qt::Key_Asterisk; if (str == "apostrophe") return Qt::Key_Apostrophe; if (str == "plus") return Qt::Key_Plus; + if (str == "KP_Add") return Qt::Key_Plus; if (str == "minus") return Qt::Key_Minus; + if (str == "KP_Subtract") return Qt::Key_Minus; if (str == "comma") return Qt::Key_Comma; if (str == "period") return Qt::Key_Period; + if (str == "KP_Decimal") return Qt::Key_Period; if (str == "slash") return Qt::Key_Slash; + if (str == "KP_Divide") return Qt::Key_Slash; if (str == "asciitilde") return Qt::Key_AsciiTilde; if (str == "braceleft") return Qt::Key_BraceLeft; if (str == "braceright") return Qt::Key_BraceRight; @@ -319,9 +340,10 @@ int string_to_qkey(string const & str) if (str == "Hyper_L") return Qt::Key_Hyper_L; if (str == "Hyper_R") return Qt::Key_Hyper_R; if (str == "Help") return Qt::Key_Help; - if (str == "Bar") return Qt::Key_Bar; if (str == "BackTab") return Qt::Key_Backtab; + lyxerr << "unknown key name `" << str << "'" << std::endl; + return Qt::Key_unknown; }