]> git.lyx.org Git - features.git/commitdiff
Fix the shortcut input dialog bug (can not input Ctrl-blah)
authorBo Peng <bpeng@lyx.org>
Tue, 30 Oct 2007 16:04:48 +0000 (16:04 +0000)
committerBo Peng <bpeng@lyx.org>
Tue, 30 Oct 2007 16:04:48 +0000 (16:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21291 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiKeySymbol.cpp
src/frontends/qt4/qlkey.h

index 8a3a1a3017bccfcd189cb08e298e954046fd4858..0670a37198f99e5ca7cd8c42bda53ad745a6b72c 100644 (file)
@@ -82,6 +82,11 @@ void setKeySymbol(KeySymbol * sym, QKeyEvent * ev)
                sym->setText(docstring());
                return;
        }
+       LYXERR(Debug::KEY) << "Getting key " << ev->key() << ", with text '"
+               << fromqstr(ev->text()) << "'" << std::endl;
+       // This is unsafe because ev->text() is the unicode representation of the
+       // key, not the name of the key. For example, Ctrl-x and Alt-x produce 
+       // different texts.
        sym->setText(qstring_to_ucs4(ev->text()));
        LYXERR(Debug::KEY) << "Setting key to " << sym->key() << ", "
                << to_utf8(sym->text()) << endl;
@@ -117,7 +122,7 @@ string KeySymbol::getSymbolName() const
 {
        string name = qkey_to_string(key_);
 
-       // e.g. A-Za-z, and others
+       // others
        if (name.empty())
                name = to_utf8(text_);
 
index 3d9d35cb400350b13bf30c995a00d61f7e6f6bce..9fb0290dc50bbaed35d073fd3d15f9b8736e27f1 100644 (file)
@@ -505,6 +505,43 @@ std::string const qkey_to_string(int lkey)
        case Qt::Key_ssharp: return "ssharp";
        case Qt::Key_ydiaeresis: return "ydiaeresis";
 
+       case Qt::Key_A: return "A";
+       case Qt::Key_B: return "B";
+       case Qt::Key_C: return "C";
+       case Qt::Key_D: return "D";
+       case Qt::Key_E: return "E";
+       case Qt::Key_F: return "F";
+       case Qt::Key_G: return "G";
+       case Qt::Key_H: return "H";
+       case Qt::Key_I: return "I";
+       case Qt::Key_J: return "J";
+       case Qt::Key_K: return "K";
+       case Qt::Key_L: return "L";
+       case Qt::Key_M: return "M";
+       case Qt::Key_N: return "N";
+       case Qt::Key_O: return "O";
+       case Qt::Key_P: return "P";
+       case Qt::Key_Q: return "Q";
+       case Qt::Key_R: return "R";
+       case Qt::Key_S: return "S";
+       case Qt::Key_T: return "T";
+       case Qt::Key_U: return "U";
+       case Qt::Key_V: return "V";
+       case Qt::Key_W: return "W";
+       case Qt::Key_X: return "X";
+       case Qt::Key_Y: return "Y";
+       case Qt::Key_Z: return "Z";
+       case Qt::Key_0: return "0";
+       case Qt::Key_1: return "1";
+       case Qt::Key_2: return "2";
+       case Qt::Key_3: return "3";
+       case Qt::Key_4: return "4";
+       case Qt::Key_5: return "5";
+       case Qt::Key_6: return "6";
+       case Qt::Key_7: return "7";
+       case Qt::Key_8: return "8";
+       case Qt::Key_9: return "9";
+
        // FIXME: these ones I don't know the names of ... help !
        // what's here is basically guesses ...
        case Qt::Key_Super_L: return "Super_L";