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
9 * Full author contact details are available in file CREDITS.
15 #include "KeyModifier.h"
17 #include "support/docstring.h"
23 * This is a class representing a keypress.
28 KeySymbol() : key_(0) {}
31 bool operator==(KeySymbol const & ks) const;
33 /// Initialize with the name of a key. F. ex. "space" or "a"
34 void init(std::string const & symbolname);
36 /// Is this a valid key?
39 /// Is this a modifier key only?
40 bool isModifier() const;
42 /// Is this normal insertable text ? (last ditch attempt only)
45 /// What is the symbolic name of this key? F.ex. "Return" or "c"
46 std::string getSymbolName() const;
49 * Return the value of the keysym into the UCS-4 encoding.
50 * This converts the KeySymbol to a 32-bit encoded character.
52 char_type getUCSEncoded() const;
55 * Return a string describing the KeySym with modifier mod.
56 * Use the native UI format when \c forgui is true.
57 * i.e. (translated and with special characters for Mac OS X)
59 docstring const print(KeyModifier mod, bool forgui, bool untranslated = false) const;
62 int key() const { return key_; }
64 void setKey(int key) { key_ = key; }
66 docstring text() const { return text_; }
68 void setText(docstring const & text) { text_ = text; }
70 /// some platform specific sym value
72 /// the event string value