16 bool isDefined()
const {
return (m_data !=
nullptr); }
17 const char *
text()
const;
19 static constexpr
const char * k_textless =
"";
24 #define TL() EventData::Textless() 25 #define U() EventData::Undefined() 26 #define T(x) EventData::Text(x) 41 T(k_exponential),
T(
"ln()"),
T(
"log()"),
T(k_complexI),
T(
","),
T(
"^"),
42 T(
"sin()"),
T(
"cos()"),
T(
"tan()"),
T(k_pi),
T(k_root),
T(
"^2"),
43 T(
"7"),
T(
"8"),
T(
"9"),
T(
"("),
T(
")"),
U(),
44 T(
"4"),
T(
"5"),
T(
"6"),
T(k_multiplicationSign),
T(
"/"),
U(),
45 T(
"1"),
T(
"2"),
T(
"3"),
T(
"+"),
T(
"-"),
U(),
46 T(
"0"),
T(
"."),
T(k_exponent),
TL(),
TL(),
U(),
49 U(),
U(),
U(),
U(),
U(),
U(),
51 T(
"["),
T(
"]"),
T(
"{"),
T(
"}"),
T(
"_"),
T(k_sto),
52 T(
"asin()"),
T(
"acos()"),
T(
"atan()"),
T(
"="),
T(
"<"),
T(
">"),
53 U(),
U(),
U(),
U(),
U(),
U(),
54 U(),
U(),
U(),
U(),
U(),
U(),
55 U(),
U(),
U(),
U(),
U(),
U(),
56 U(),
U(),
U(),
U(),
U(),
U(),
58 U(),
U(),
U(),
U(),
U(),
U(),
59 U(),
U(),
U(),
U(),
U(),
U(),
60 U(),
U(),
T(
":"),
T(
";"),
T(
"\""),
U(),
61 T(
"a"),
T(
"b"),
T(
"c"),
T(
"d"),
T(
"e"),
T(
"f"),
62 T(
"g"),
T(
"h"),
T(
"i"),
T(
"j"),
T(
"k"),
T(
"l"),
63 T(
"m"),
T(
"n"),
T(
"o"),
T(
"p"),
T(
"q"),
U(),
64 T(
"r"),
T(
"s"),
T(
"t"),
T(
"u"),
T(
"v"),
U(),
65 T(
"w"),
T(
"x"),
T(
"y"),
T(
"z"),
T(
" "),
U(),
66 T(
"?"),
T(
"!"),
U(),
U(),
U(),
U(),
68 U(),
U(),
U(),
U(),
U(),
U(),
69 U(),
U(),
U(),
U(),
U(),
U(),
70 U(),
U(),
U(),
U(),
U(),
U(),
71 T(
"A"),
T(
"B"),
T(
"C"),
T(
"D"),
T(
"E"),
T(
"F"),
72 T(
"G"),
T(
"H"),
T(
"I"),
T(
"J"),
T(
"K"),
T(
"L"),
73 T(
"M"),
T(
"N"),
T(
"O"),
T(
"P"),
T(
"Q"),
U(),
74 T(
"R"),
T(
"S"),
T(
"T"),
T(
"U"),
T(
"V"),
U(),
75 T(
"W"),
T(
"X"),
T(
"Y"),
T(
"Z"),
U(),
U(),
76 U(),
U(),
U(),
U(),
U(),
U(),
80 if (m_data ==
nullptr || m_data == k_textless) {
97 int noFallbackOffsets[] = {0};
98 int shiftFallbackOffsets[] = {
PageSize, 0};
99 int alphaFallbackOffsets[] = {2*
PageSize, 0};
102 int * fallbackOffsets[] = {noFallbackOffsets, shiftFallbackOffsets, alphaFallbackOffsets, shiftAlphaFallbackOffsets};
104 int * fallbackOffset = fallbackOffsets[shift+2*alpha];
108 offset = fallbackOffset[i++];
109 m_id = offset + (int)key;
119 return s_dataForEvent[m_id].
text();
123 return text() !=
nullptr;
136 static constexpr
const char * s_nameForEvent[255] = {
138 "Left",
"Up",
"Down",
"Right",
"OK",
"Back",
139 "Home",
"OnOff",
nullptr,
nullptr,
nullptr,
nullptr,
140 "Shift",
"Alpha",
"XNT",
"Var",
"Toolbox",
"Backspace",
141 "Exp",
"Ln",
"Log",
"Imaginary",
"Comma",
"Power",
142 "Sine",
"Cosine",
"Tangent",
"Pi",
"Sqrt",
"Square",
143 "Seven",
"Eight",
"Nine",
"LeftParenthesis",
"RightParenthesis",
nullptr,
144 "Four",
"Five",
"Six",
"Multiplication",
"Division",
nullptr,
145 "One",
"Two",
"Three",
"Plus",
"Minus",
nullptr,
146 "Zero",
"Dot",
"EE",
"Ans",
"EXE",
nullptr,
148 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
149 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
150 nullptr,
"AlphaLock",
"Cut",
"Copy",
"Paste",
"Clear",
151 "LeftBracket",
"RightBracket",
"LeftBrace",
"RightBrace",
"Underscore",
"Sto",
152 "Arcsine",
"Arccosine",
"Arctangent",
"Equal",
"Lower",
"Greater",
153 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
154 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
155 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
156 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
158 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
159 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
160 nullptr,
nullptr,
"Colon",
"SemiColon",
"DoubleQuotes",
nullptr,
161 "LowerA",
"LowerB",
"LowerC",
"LowerD",
"LowerE",
"LowerF",
162 "LowerG",
"LowerH",
"LowerI",
"LowerJ",
"LowerK",
"LowerL",
163 "LowerM",
"LowerN",
"LowerO",
"LowerP",
"LowerQ",
nullptr,
164 "LowerR",
"LowerS",
"LowerT",
"LowerU",
"LowerV",
nullptr,
165 "LowerW",
"LowerX",
"LowerY",
"LowerZ",
"Space",
nullptr,
166 "Question",
"Exclamation",
nullptr,
nullptr,
nullptr,
nullptr,
168 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
169 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
170 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
171 "UpperA",
"UpperB",
"UpperC",
"UpperD",
"UpperE",
"UpperF",
172 "UpperG",
"UpperH",
"UpperI",
"UpperJ",
"UpperK",
"UpperL",
173 "UpperM",
"UpperN",
"UpperO",
"UpperP",
"UpperQ",
nullptr,
174 "UpperR",
"UpperS",
"UpperT",
"UpperU",
"UpperV",
nullptr,
175 "UpperW",
"UpperX",
"UpperY",
"UpperZ",
nullptr,
nullptr,
177 "None",
"Termination",
nullptr,
nullptr,
nullptr,
nullptr,
180 const char * Event::name()
const {
181 return s_nameForEvent[m_id];
static constexpr EventData Text(const char *text)
const char * text() const
constexpr int NumberOfKeys
const char * text() const
bool isKeyboardEvent() const
static constexpr EventData Undefined()
static constexpr EventData Textless()
static constexpr int PageSize
constexpr Event USBEnumeration
constexpr Event Termination