MCPcopy Create free account
hub / github.com/aiekick/ImGuiFileDialog / m_LocateByInputKey

Method m_LocateByInputKey

ImGuiFileDialog.cpp:3414–3445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3412}
3413
3414void IGFD::KeyExplorerFeature::m_LocateByInputKey(FileDialogInternal& vFileDialogInternal) {
3415 ImGuiContext& g = *GImGui;
3416 auto& fdi = vFileDialogInternal.fileManager;
3417 if (!g.ActiveId && !fdi.IsFilteredListEmpty()) {
3418 auto& queueChar = ImGui::GetIO().InputQueueCharacters;
3419 auto countFiles = fdi.GetFilteredListSize();
3420
3421 // point by char
3422 if (!queueChar.empty()) {
3423 ImWchar c = queueChar.back();
3424 if (m_LocateFileByInputChar_InputQueueCharactersSize != queueChar.size()) {
3425 if (c == m_LocateFileByInputChar_lastChar) // next file starting with same char until
3426 {
3427 if (m_LocateFileByInputChar_lastFileIdx < countFiles - 1U)
3428 m_LocateFileByInputChar_lastFileIdx++;
3429 else
3430 m_LocateFileByInputChar_lastFileIdx = 0;
3431 }
3432
3433 if (!m_LocateItem_Loop(vFileDialogInternal, c)) {
3434 // not found, loop again from 0 this time
3435 m_LocateFileByInputChar_lastFileIdx = 0;
3436 m_LocateItem_Loop(vFileDialogInternal, c);
3437 }
3438
3439 m_LocateFileByInputChar_lastChar = c;
3440 }
3441 }
3442
3443 m_LocateFileByInputChar_InputQueueCharactersSize = queueChar.size();
3444 }
3445}
3446
3447void IGFD::KeyExplorerFeature::m_ExploreWithkeys(FileDialogInternal& vFileDialogInternal, ImGuiID vListViewID) {
3448 auto& fdi = vFileDialogInternal.fileManager;

Callers

nothing calls this directly

Calls 4

IsFilteredListEmptyMethod · 0.80
GetFilteredListSizeMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected