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"
20 QLyXKeySym::QLyXKeySym()
21 : LyXKeySym(), key_(0), shift_(false)
26 void QLyXKeySym::set(int key, bool shift)
33 void QLyXKeySym::init(string const & symbolname)
35 key_ = string_to_qkey(symbolname);
39 bool QLyXKeySym::isOK() const
46 bool QLyXKeySym::isModifier() const
48 return q_is_modifier(key_);
52 string QLyXKeySym::getSymbolName() const
54 return qkey_to_string(key_, shift_);
58 char QLyXKeySym::getISOEncoded() const
60 /* Even though we could try to use QKeyEvent->text(),
61 * it won't work, because it returns something other
62 * than 'Z' for things like C-S-z. Do not ask me why,
63 * just more Qt bullshit.
65 return qkey_to_char(key_, shift_);
69 bool QLyXKeySym::operator==(LyXKeySym const & k) const
71 QLyXKeySym const & o = static_cast<QLyXKeySym const &>(k);
72 return o.key_ == key_;