]> git.lyx.org Git - features.git/commitdiff
Remove crap again. Make redo key binding work.
authorJohn Levon <levon@movementarian.org>
Sun, 25 Aug 2002 06:45:16 +0000 (06:45 +0000)
committerJohn Levon <levon@movementarian.org>
Sun, 25 Aug 2002 06:45:16 +0000 (06:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5100 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QLyXKeySym.C
src/frontends/qt2/QLyXKeySym.h
src/frontends/qt2/qlkey.h

index f210ddf82eaa7659eac9328dd1bc7426f70d365f..58bd3472a7d6218a7ea32ed838c6cf36810d3913 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-25  John Levon  <levon@movementarian.org>
+
+       * qlkey.h: add A-Z into string_to_qkey
+
+       * QLyXKeySym.h:
+       * QLyXKeySym.C: remove crap again
 2002-08-25  John Levon  <levon@movementarian.org>
 
        * QLyXKeySym.h:
index 28218ed65daf99978629a9d7e12ee4e9cdbcff0f..abc25247988f64d9ea447e48c4b6c63ad3992345 100644 (file)
@@ -29,7 +29,6 @@ void QLyXKeySym::set(QKeyEvent * ev)
 {
        key_ = ev->key();
        text_ = ev->text(); 
-       ascii_ = ev->ascii();
 }
  
 
@@ -37,7 +36,6 @@ void QLyXKeySym::init(string const & symbolname)
 {
        key_ = string_to_qkey(symbolname);
        text_ = symbolname.c_str();
-       ascii_ = 0;
        lyxerr[Debug::KEY] << "Init key to " << key_ << ", " << text_ << endl;
 }
 
@@ -54,39 +52,13 @@ bool QLyXKeySym::isModifier() const
 }
 
 
-// This is one ALMIGHTY hack. When you press C-S-z, you get
-// "Press key 90 text "?", ascii "26"
-// where text is meaningless. So we check specifically
-// for this case ! (90 is 'Z')
-// We also check against 0 for when we're comparing
-// against a stored binding. 
-bool QLyXKeySym::is_qt_bogon() const
-{
-       if (ascii_ == 0)
-               return false;
-       return (ascii_ < 27 && !text_.isEmpty());
-} 
-char QLyXKeySym::debogonify() const
-{
-       return 'A' + ascii_ - 1;
-}
-
-
 string QLyXKeySym::getSymbolName() const
 {
        string sym(qkey_to_string(key_));
 
-       // deal with "A", "a" properly
        if (sym.empty()) {
                lyxerr[Debug::KEY] << "sym empty in getSymbolName()" << endl;
-               if (is_qt_bogon()) {
-                       sym = debogonify();
-               } else {
-                       sym = text_.latin1();
-               }
+               sym = text_.latin1();
        }
        lyxerr[Debug::KEY] << "getSymbolName() -> " << sym << endl;
        return sym;
@@ -96,11 +68,6 @@ string QLyXKeySym::getSymbolName() const
 char QLyXKeySym::getISOEncoded() const
 {
        lyxerr[Debug::KEY] << "getISO returning " << text_.latin1()[0] << endl;
-
-       if (is_qt_bogon()) {
-               return debogonify();
-       }
        return text_.latin1()[0]; 
 }
  
index 538e81fad618082f8a3455cc32fd90d28b9bd94f..da3f6d058377e1f554503afa63798298b2288d3e 100644 (file)
@@ -58,18 +58,10 @@ public:
        virtual bool operator==(LyXKeySym const & k) const;
 
 private:
-       /// return true if bogon (see source)
-       bool is_qt_bogon() const;
-
-       /// return the fixed bogon (see source)
-       char debogonify() const;
        /// the Qt sym value
        int key_;
        /// the event string value 
        QString text_;
-       /// hack-o-rama
-       int ascii_; 
 };
 
 #endif // QLYXKEYSYM_H
index 59365ea1831b097b219e7c0c620b5bf6d7c19738..8048e80a0d2298711eac755491360b4597d73588 100644 (file)
@@ -117,6 +117,32 @@ int string_to_qkey(string const & str)
        if (str == "greater") return Qt::Key_Greater;
        if (str == "question") return Qt::Key_Question;
        if (str == "at") return Qt::Key_At;
+       if (str == "A") return Qt::Key_A;
+       if (str == "B") return Qt::Key_B;
+       if (str == "C") return Qt::Key_C;
+       if (str == "D") return Qt::Key_D;
+       if (str == "E") return Qt::Key_E;
+       if (str == "F") return Qt::Key_F;
+       if (str == "G") return Qt::Key_G;
+       if (str == "H") return Qt::Key_H;
+       if (str == "I") return Qt::Key_I;
+       if (str == "J") return Qt::Key_J;
+       if (str == "K") return Qt::Key_K;
+       if (str == "L") return Qt::Key_L;
+       if (str == "M") return Qt::Key_M;
+       if (str == "N") return Qt::Key_N;
+       if (str == "O") return Qt::Key_O;
+       if (str == "P") return Qt::Key_P;
+       if (str == "Q") return Qt::Key_Q;
+       if (str == "R") return Qt::Key_R;
+       if (str == "S") return Qt::Key_S;
+       if (str == "T") return Qt::Key_T;
+       if (str == "U") return Qt::Key_U;
+       if (str == "V") return Qt::Key_V;
+       if (str == "W") return Qt::Key_W;
+       if (str == "X") return Qt::Key_X;
+       if (str == "Y") return Qt::Key_Y;
+       if (str == "Z") return Qt::Key_Z;
        if (str == "a") return Qt::Key_A;
        if (str == "b") return Qt::Key_B;
        if (str == "c") return Qt::Key_C;