template<class TextInputEvent> bool Context::handleTextInputEvent(TextInputEvent& event) { /* Ensure we use the context we're linked to */ ImGui::SetCurrentContext(_context); ImGui::GetIO().AddInputCharactersUTF8(event.text().data()); return false; }
void ScriptInput::onCharInput(const TextInputEvent& ev) { if (PlayInEditorManager::instance().getState() != PlayInEditorState::Playing) return; MonoUtil::invokeThunk(OnCharInputThunk, ev.textChar, ev.isUsed()); }
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); } }
void ScriptEditorInput::onCharInput(const TextInputEvent& ev) { MonoUtil::invokeThunk(OnCharInputThunk, ev.textChar, ev.isUsed()); }