You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
segross/UnrealImGui
Version: 1.65
UE4 Windows 64 bit
Operating System: Windows 10 64bit
If using a gamepad to navigate main menu bar there seems to be no way to set focus to the first selection on the menu bar. Other items seem to accept focus correctly.
Have checked the demos and have noticed that the only way to navigate, initially, to the menu bar is to use mouse. Once there it is possible to continue to navigate the menu bar using gamepad again correctly, until it looses focus.
if (ImGui::BeginMainMenuBar())
{
if (ImGui::BeginMenu("Level"))
{
// Focus here
ImGui::SetKeyboardFocusHere();
if (ImGui::MenuItem("Restart Level"))
{
AGameModeBase* ourGameMode = Cast<AGameModeBase>(GetWorld()->GetAuthGameMode());
checkf(ourGameMode, TEXT("Failed to get the game mode"));
ourGameMode->RestartGame();
}
// Level menu
ImGui::EndMenu();
}
// Pawns
if (ImGui::BeginMenu("Pawns"))
{
if (ImGui::MenuItem("Change Player 0 Pawn"))
{
// To be implemented
}
if (ImGui::MenuItem("Change Player 1 Pawn"))
{
// To be implemented
}
// Pawns
ImGui::EndMenu();
}
// Completed menu bar
ImGui::EndMainMenuBar();
}
The text was updated successfully, but these errors were encountered:
(A)
There is indeed currently no way to forward Alt/Square tap from one regular window to the main menu bar which is another window, so you are right you cannot tap Square button to access the main menu bar, only a local menu bar within current window. This is something that I'd like to implement. However you can currently use Ctrl+Tab (hold Square+L/R) to focus another window and access the menu bar this way.
(B)
I think your issue could be related to the bug #343 due to clipping.
You may use an if (IsWindowAppearing()) { ... } block to run the code on the second frame.
However I don't see the use for SetKeyboardFocusHere() on a MenuItem, this function activate the item (e.g. InputText). What you want to use is SetItemDefaultFocus() instead, but your example is confusing because it would be absolutely unnecessary to call SetItemDefaultFocus on the first item of a window since this is will be focused already when using navigation. So maybe I don't understand your issue properly?
(I am aware the focus/nav functions are currently a little bit of a mess pending a redesign/refactor of the API, please excuse it!)
…for clipped items. (#343, #4079, #2352, #432)
+ Removed references to counter used by previous implementation of SetKeyboardFocus functions (the TabStop ones will be removed after)
I'm having the same issue with UnrealImGui but could also reproduce on imgui_impl_win32 + imgui_impl_dx12.
The behaviour I'm aiming at is for the main menu bar to get focus at launch, without using X or ctrl+tab to gain focus.
Is it doable ?
segross/UnrealImGui
Version: 1.65
UE4 Windows 64 bit
Operating System: Windows 10 64bit
If using a gamepad to navigate main menu bar there seems to be no way to set focus to the first selection on the menu bar. Other items seem to accept focus correctly.
Have checked the demos and have noticed that the only way to navigate, initially, to the menu bar is to use mouse. Once there it is possible to continue to navigate the menu bar using gamepad again correctly, until it looses focus.
The text was updated successfully, but these errors were encountered: