MCPcopy Create free account
hub / github.com/crossuo/crossuo / OnTextInput

Method OnTextInput

src/ScreenStages/MainScreen.cpp:122–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void CMainScreen::OnTextInput(const TextEvent &ev)
123{
124 const auto ch = EvChar(ev);
125 if (!IsPrintable(ch) || !g_FontManager.IsPrintASCII((uint8_t)ch))
126 {
127 return;
128 }
129 if (g_EntryPointer == nullptr)
130 {
131 g_EntryPointer = m_MainGump.m_PasswordFake;
132 }
133
134 if (g_EntryPointer->Length() < 16) //add char to text field
135 {
136 if (g_EntryPointer == m_MainGump.m_PasswordFake)
137 {
138 if (g_EntryPointer->Insert(L'*'))
139 {
140 m_Password->Insert(ch);
141 }
142 }
143 else
144 {
145 g_EntryPointer->Insert(ch);
146 }
147 }
148
149 m_Gump.WantRedraw = true;
150}
151
152void CMainScreen::OnKeyDown(const KeyEvent &ev)
153{

Callers

nothing calls this directly

Calls 3

IsPrintASCIIMethod · 0.80
LengthMethod · 0.80
InsertMethod · 0.45

Tested by

no test coverage detected