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.
17 #include "key_state.h"
19 #include "support/docstring.h"
25 * This is a class representing a keypress.
30 KeySymbol() : key_(0) {}
33 bool operator==(KeySymbol const & ks) const;
35 /// Initialize with the name of a key. F. ex. "space" or "a"
36 void init(std::string const & symbolname);
38 /// Is this a valid key?
41 /// Is this a modifier key only?
42 bool isModifier() const;
44 /// Is this normal insertable text ? (last ditch attempt only)
47 /// What is the symbolic name of this key? F.ex. "Return" or "c"
48 std::string getSymbolName() const;
51 * Return the value of the keysym into the UCS-4 encoding.
52 * This converts the KeySymbol to a 32-bit encoded character.
54 char_type getUCSEncoded() const;
57 * Return a string describing the KeySym with modifier mod.
58 * Use the native UI format when \c forgui is true.
59 * i.e. (translated and with special characters for Mac OS X)
61 docstring const print(key_modifier::state mod, bool forgui) const;
64 int key() const { return key_; }
66 void setKey(int key) { key_ = key; }
68 docstring text() const { return text_; }
70 void setText(docstring const & text) { text_ = text; }
72 /// some platform specific sym value
74 /// the event string value