Enabled ImGui navigation with keyboard and game controller.

Ref issue #92.
This commit is contained in:
Muzychenko Andrey committed 2021-11-15 17:32:18 +03:00
1 parent 8ab50ea7b7
commit 200a7dbf79
2 files changed
+12 -3

No files matched your search

+3 -1
View File
@@ -379,7 +379,9 @@ static void ImGui_ImplSDL2_UpdateGamepads()
return;
// Get gamepad
SDL_GameController* game_controller = SDL_GameControllerOpen(0);
SDL_GameController* game_controller = nullptr;
if (SDL_NumJoysticks() > 0 && SDL_IsGameController(0))
game_controller = SDL_GameControllerOpen(0);
if (!game_controller)
{
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;