mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
Nav: Activate InputSource as Gamepad when pressing any of the digital d-pad button.
This commit is contained in:
parent
8d71bc2132
commit
b30d33378d
@ -8528,9 +8528,12 @@ static void ImGui::NavUpdate()
|
||||
// (do it before we map Keyboard input!)
|
||||
bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
|
||||
bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
|
||||
if (nav_gamepad_active)
|
||||
if (io.NavInputs[ImGuiNavInput_Activate] > 0.0f || io.NavInputs[ImGuiNavInput_Input] > 0.0f || io.NavInputs[ImGuiNavInput_Cancel] > 0.0f || io.NavInputs[ImGuiNavInput_Menu] > 0.0f)
|
||||
if (nav_gamepad_active && g.NavInputSource != ImGuiInputSource_NavGamepad)
|
||||
{
|
||||
if (io.NavInputs[ImGuiNavInput_Activate] > 0.0f || io.NavInputs[ImGuiNavInput_Input] > 0.0f || io.NavInputs[ImGuiNavInput_Cancel] > 0.0f || io.NavInputs[ImGuiNavInput_Menu] > 0.0f
|
||||
|| io.NavInputs[ImGuiNavInput_DpadLeft] > 0.0f || io.NavInputs[ImGuiNavInput_DpadRight] > 0.0f || io.NavInputs[ImGuiNavInput_DpadUp] > 0.0f || io.NavInputs[ImGuiNavInput_DpadDown] > 0.0f)
|
||||
g.NavInputSource = ImGuiInputSource_NavGamepad;
|
||||
}
|
||||
|
||||
// Update Keyboard->Nav inputs mapping
|
||||
if (nav_keyboard_active)
|
||||
|
Loading…
Reference in New Issue
Block a user