MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / inputTextCallback

Method inputTextCallback

Source/Falcor/Utils/Scripting/Console.cpp:185–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185int Console::inputTextCallback(ImGuiInputTextCallbackData* data)
186{
187 FALCOR_ASSERT(data->UserData != nullptr);
188 Console& console = *static_cast<Console*>(data->UserData);
189
190 if (data->EventFlag == ImGuiInputTextFlags_CallbackCharFilter)
191 {
192 if (data->EventChar == '`')
193 return 1;
194 }
195 if (data->EventFlag == ImGuiInputTextFlags_CallbackHistory)
196 {
197 if (auto cmd = console.browseHistory(data->EventKey == ImGuiKey_UpArrow))
198 {
199 strncpy(data->Buf, cmd->c_str(), cmd->length() + 1);
200 data->BufTextLen = data->CursorPos = (int)cmd->length();
201 data->BufDirty = true;
202 }
203 }
204 return 0;
205}
206} // namespace Falcor

Callers

nothing calls this directly

Calls 2

browseHistoryMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected