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
34 virtual ~GuiKeySymbol() {}
37 /// inlined out because of profiling results under linux when
38 /// opening a document.
39 inline bool operator==(KeySymbol const& ks) const;
41 /// delayed constructor
42 void set(QKeyEvent * ev);
44 /// set from a LyX symbolic name
45 virtual void init(std::string const & symbolname);
47 /// Is this a valid key?
48 virtual bool isOK() const;
50 /// Is this a modifier key only?
51 virtual bool isModifier() const;
53 /// return the LyX symbolic name
54 virtual std::string getSymbolName() const;
56 /// Is this normal insertable text ? (last ditch attempt only)
57 virtual bool isText() const;
60 * Return the value of the keysym into the UCS-4 encoding.
61 * This converts the KeySymbol to a 32-bit encoded character.
63 virtual char_type getUCSEncoded() const;
66 * Return a human-readable version of a key+modifier pair.
67 * This will be the GUI version (translated and with special
68 * characters for Mac OS X) when \c forgui is true.
70 virtual docstring const print(key_modifier::state mod, bool forgui) const;
73 int key() const { return key_; }
78 /// the event string value
82 /// return the LyX key state from Qt's
83 key_modifier::state q_key_state(Qt::KeyboardModifiers state);