4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Asger and Jürgen
10 * Full author contact details are available in file CREDITS.
16 #include "frontends/KeySymbol.h"
25 * Qt-specific key press.
27 * This is some really sick stuff.
29 class GuiKeySymbol : public KeySymbol {
33 virtual ~GuiKeySymbol() {}
36 /// inlined out because of profiling results under linux when
37 /// opening a document.
38 inline bool operator==(KeySymbol const& ks) const;
40 /// delayed constructor
41 void set(QKeyEvent * ev);
43 /// set from a LyX symbolic name
44 virtual void init(std::string const & symbolname);
46 /// Is this a valid key?
47 virtual bool isOK() const;
49 /// Is this a modifier key only?
50 virtual bool isModifier() const;
52 /// return the LyX symbolic name
53 virtual std::string getSymbolName() const;
55 /// Is this normal insertable text ? (last ditch attempt only)
56 virtual bool isText() const;
59 * Return the value of the keysym into the UCS-4 encoding.
60 * This converts the KeySymbol to a 32-bit encoded character.
62 virtual char_type getUCSEncoded() const;
65 * Return a human-readable version of a key+modifier pair.
66 * This will be the GUI version (translated and with special
67 * characters for Mac OS X) when \c forgui is true.
69 virtual docstring const print(key_modifier::state mod, bool forgui) const;
72 int key() const { return key_; }
77 /// the event string value
81 /// return the LyX key state from Qt's
82 key_modifier::state q_key_state(Qt::KeyboardModifiers state);