| 183 | } |
| 184 | |
| 185 | int 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 |
nothing calls this directly
no test coverage detected