void Textbox::textInputEvent(const TextInputEvent &event) { const std::string &newText = event.getText(); for (auto iter = newText.cbegin(); iter != newText.cend(); ++iter) { char letter = *iter; if ((int) text.length() < max && allowedCharacters.find(letter) != std::string::npos) { text.push_back(letter); } } }
void Application::textInputEvent(Context& context, const TextInputEvent& event) { if (console.isActive()) { console.textInputEvent(event.getText()); } else { context.textInputEvent(event); } }