From: John Levon Date: Sun, 25 Aug 2002 06:45:16 +0000 (+0000) Subject: Remove crap again. Make redo key binding work. X-Git-Tag: 1.6.10~18468 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=85aca478e17d7e33e9ec3e2e30c370528d761ade;p=features.git Remove crap again. Make redo key binding work. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5100 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index f210ddf82e..58bd3472a7 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,10 @@ +2002-08-25 John Levon + + * qlkey.h: add A-Z into string_to_qkey + + * QLyXKeySym.h: + * QLyXKeySym.C: remove crap again + 2002-08-25 John Levon * QLyXKeySym.h: diff --git a/src/frontends/qt2/QLyXKeySym.C b/src/frontends/qt2/QLyXKeySym.C index 28218ed65d..abc2524798 100644 --- a/src/frontends/qt2/QLyXKeySym.C +++ b/src/frontends/qt2/QLyXKeySym.C @@ -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]; } diff --git a/src/frontends/qt2/QLyXKeySym.h b/src/frontends/qt2/QLyXKeySym.h index 538e81fad6..da3f6d0583 100644 --- a/src/frontends/qt2/QLyXKeySym.h +++ b/src/frontends/qt2/QLyXKeySym.h @@ -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 diff --git a/src/frontends/qt2/qlkey.h b/src/frontends/qt2/qlkey.h index 59365ea183..8048e80a0d 100644 --- a/src/frontends/qt2/qlkey.h +++ b/src/frontends/qt2/qlkey.h @@ -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;