-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way for block navigation for custom widgets ? #3712
Comments
For a specific window you can use the For specific widget there are internals facilities such as |
thanks, will try that btw i not want to disable this feature for the whole window, just when my widget is focused for let him explore it |
hello, Finally i got a solution to my problem, when the NavId is the listview id, if i hit the enter key i active my list view nav system but not sure if its robust enough is there a better (more robust in time) way ? i activate the item with both ImGui::ActivateItem and ImGui::SetActiveID. here my code : bool canWeExplore = false;
bool hasNav = (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard);
ImGuiContext& g = *GImGui;
if (!hasNav && !g.ActiveId) // no nav and no activated inputs
canWeExplore = true;
if (g.NavId && g.NavId == vListViewID)
{
if (ImGui::IsKeyPressedMap(ImGuiKey_Enter) ||
ImGui::IsKeyPressedMap(ImGuiKey_KeyPadEnter))
{
ImGui::ActivateItem(vListViewID);
ImGui::SetActiveID(vListViewID, g.CurrentWindow);
}
}
if (vListViewID == g.LastActiveId-1) // if listview id is the last acticated nav id (ImGui::ActivateItem(vListViewID);)
canWeExplore = true;
if (canWeExplore)
{
if (ImGui::IsKeyPressedMap(ImGuiKey_Escape))
{
ImGui::ClearActiveID();
g.LastActiveId = 0;
}
// actions
} what do you think about it ? |
See general answer in #3560 (comment) You can claim ownership of a key ahead of time and Nav system won't use that key. |
its not an issue.
in ImGuiFileDialog, i have implemented up/down return/backspace navigation for explore file/directory list
you navigation system work like a charm for select widgets.
but when the file list is focused i would like to have a way for block your navigation.
for have mine only working. like i can explore the list with my navigation system only when the file lsit is focused.
here you see my navigation work in parrallel of your and its annoying.
by ex i would like to press ctrl key when the file list is focused. and with ctrl key pressed navigate with my system
if i implement the imgui nav system in my filelist, it can be annoying when we have big file list
i not found a way in the src files for doing that. but maybe i miss something.
The text was updated successfully, but these errors were encountered: