Open MacroController opened 7 months ago
Since gamepad is handled by platform backend we could decide to program backends this way. IMHO it should be an option.
ImGuiIO:
[...]
bool ConfigGamepadNeedAppFocus;
The setting could be honored by dear imgui by filtering Gamepad_xxx events based on io.AppFocusLost
OR be honored by backend code. I think the earlier would be simpler to implement.
Version/Branch of Dear ImGui:
Version 1.90.4, Branch: master
Back-ends:
imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Compiler, OS:
Windows 10 + MSVC 2019
Full config/build information:
Details:
I launch the
examples/*/main.cpp
corresponding to my backends; with the addition of the MCVE I provided. This MCVE callsImGui::IsKeyPressed(...)
with either keyboard or gamepad input, and display information based on the return value of the call.ImGui::IsKeyPressed(ImGuiKey_Q)
, it returnstrue
when I press theQ
keyboard key ONLY if the dear imgui application is focused → if I have a text editor open besides my dear imgui application:ImGui::IsKeyPressed(ImGuiKey_GamepadL1)
, it returnstrue
when I press theL1
gamepad button REGARDLESS of the focus of the dear imgui application → if I have a text editor open besides my dear imgui application:Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code: