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 /// Initialize with some platform specific sym value
39 /// Is this a valid key?
42 /// Is this a modifier key only?
43 bool isModifier() const;
45 /// Is this normal insertable text ? (last ditch attempt only)
48 /// What is the symbolic name of this key? F.ex. "Return" or "c"
49 std::string getSymbolName() const;
52 * Return the value of the keysym into the UCS-4 encoding.
53 * This converts the KeySymbol to a 32-bit encoded character.
55 char_type getUCSEncoded() const;
58 * Return a string describing the KeySym with modifier mod.
59 * Use the native UI format when \c forgui is true.
60 * i.e. (translated and with special characters for Mac OS X)
62 docstring const print(KeyModifier mod, bool forgui, bool untranslated = false) const;
65 int key() const { return key_; }
67 void setKey(int key) { key_ = key; }
69 docstring text() const { return text_; }
71 void setText(docstring const & text) { text_ = text; }
73 /// some platform specific sym value
75 /// the event string value