3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
6 * \author Asger and Juergen
7 * \author John Levon <moz@compsoc.man.ac.uk>
13 #pragma implementation
16 #include "QLyXKeySym.h"
24 QLyXKeySym::QLyXKeySym()
25 : LyXKeySym(), key_(0)
30 void QLyXKeySym::set(QKeyEvent * ev)
37 void QLyXKeySym::init(string const & symbolname)
39 key_ = string_to_qkey(symbolname);
40 text_ = symbolname.c_str();
41 lyxerr[Debug::KEY] << "Init key to " << key_ << ", " << text_ << endl;
45 bool QLyXKeySym::isOK() const
51 bool QLyXKeySym::isModifier() const
53 return q_is_modifier(key_);
57 string QLyXKeySym::getSymbolName() const
59 string sym(qkey_to_string(key_));
62 lyxerr[Debug::KEY] << "sym empty in getSymbolName()" << endl;
65 lyxerr[Debug::KEY] << "getSymbolName() -> " << sym << endl;
70 char QLyXKeySym::getISOEncoded() const
72 lyxerr[Debug::KEY] << "getISO returning " << text_.latin1()[0] << endl;
73 return text_.latin1()[0];
77 bool QLyXKeySym::operator==(LyXKeySym const & k) const
79 QLyXKeySym const & o = static_cast<QLyXKeySym const &>(k);
81 return o.key_ == key_;