6 static constexpr
char s_textAtIndex[] = {
'A', 0,
'B', 0,
'C', 0,
'D', 0};
14 const char *
text()
const;
24 return s_textAtIndex + (m_data >> 2);
27 static constexpr
EventInfo s_infoForEvent[] = {
43 int noFallbackOffsets[] = {0};
44 int alphaFallbackOffsets[] = {2*k_eventPageSize, 0};
45 int shiftFallbackOffsets[] = {k_eventPageSize, 0};
46 int shiftAlphaFallbackOffsets[] = {3*k_eventPageSize, 2*k_eventPageSize, 0};
48 int * fallbackOffsets[] = {noFallbackOffsets, shiftFallbackOffsets, alphaFallbackOffsets, shiftAlphaFallbackOffsets};
50 int * fallbackOffset = fallbackOffsets[shift+2*alpha];
54 offset = fallbackOffset[i++];
55 m_data = offset + (int)key;
56 }
while (offset > 0 && s_infoForEvent[m_data].isUndefined());
78 ActionInfo Event::Action::info() {
79 return s_actionInfo[(int)
this];
82 Event::Event(
Key key,
bool shift,
bool alpha) {
91 int noFallbackOffsets[] = {0};
92 int alphaFallbackOffsets[] = {2*k_actionPageSize, 0};
93 int shiftFallbackOffsets[] = {k_actionPageSize, 0};
94 int shiftAlphaFallbackOffsets[] = {3*k_actionPageSize, 2*k_actionPageSize, 0};
96 int * fallbackOffsets[] = {noFallbackOffsets, shiftFallbackOffsets, alphaFallbackOffsets, shiftAlphaFallbackOffsets};
98 int * fallbackOffset = fallbackOffsets[shift+2*alpha];
99 Action action = Action::Undefined;
104 offset = fallbackOffset[i++];
105 action = offset + (int)key;
106 }
while (offset > 0 && action.info().isUndefined());
108 assert(!action.info().isUndefined());
static constexpr EventInfo Undefined()
static constexpr EventInfo Text(int index)
const char * text() const
const char * text() const
static constexpr EventInfo Textless()