3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Asger and Juergen
9 * Full author contact details are available in file CREDITS
15 #pragma implementation
18 #include "QLyXKeySym.h"
27 QLyXKeySym::QLyXKeySym()
28 : LyXKeySym(), key_(0)
33 void QLyXKeySym::set(QKeyEvent * ev)
40 void QLyXKeySym::init(string const & symbolname)
42 key_ = string_to_qkey(symbolname);
43 text_ = symbolname.c_str();
44 lyxerr[Debug::KEY] << "Init key to " << key_ << ", " << text_ << endl;
48 bool QLyXKeySym::isOK() const
54 bool QLyXKeySym::isModifier() const
56 return q_is_modifier(key_);
60 string QLyXKeySym::getSymbolName() const
62 string sym(qkey_to_string(key_));
65 lyxerr[Debug::KEY] << "sym empty in getSymbolName()" << endl;
69 lyxerr[Debug::KEY] << "getSymbolName() -> " << sym << endl;
74 char QLyXKeySym::getISOEncoded() const
76 lyxerr[Debug::KEY] << "getISO returning " << text_.latin1()[0] << endl;
77 return text_.latin1()[0];
81 bool operator==(LyXKeySym const & k1, LyXKeySym const & k2)
83 // note we ignore text_ here (non-strict ==), because
84 // text_ is not filled out by keymap initialisation
86 return static_cast<QLyXKeySym const &>(k1).key()
87 == static_cast<QLyXKeySym const &>(k2).key();