Dear ImGui v1.87 has expanded its support for keyboard and gamepad buttons, and replaced the interface for backends to report the keys. The old way keeps working OK but is deprecated and has big limitations, thus already making "imgui-demo" run with some missing functionality when it's run through "imgui-sfml".
Code such as ImGui::IsKeyDown(ImGuiKey_Q) is supposed to work for backends that are up to date with ImGui v1.87, but imgui-sfml never reports to ImGui that that key was pressed, because in the past the set of available keys was limited:
Here you can observe the missing events:
One can just run the default "imgui-demo" and in the current state of imgui-sfml it is missing a lot of information in the "Keyboard, Gamepad & Navigation State".
And here's how I was running with ImGui's own SDL backend, to be able to compare:
c++ -I. -Ibackends -I/usr/include/SDL2 -lSDL2 -lGL examples/example_sdl_opengl3/main.cpp backends/imgui_impl_opengl3.cpp backends/imgui_impl_sdl.cpp imgui_demo.cpp imgui_widgets.cpp imgui.cpp imgui_draw.cpp imgui_tables.cpp && ./a.out
Dear ImGui v1.87 has expanded its support for keyboard and gamepad buttons, and replaced the interface for backends to report the keys. The old way keeps working OK but is deprecated and has big limitations, thus already making "imgui-demo" run with some missing functionality when it's run through "imgui-sfml".
Code such as
ImGui::IsKeyDown(ImGuiKey_Q)
is supposed to work for backends that are up to date with ImGui v1.87, but imgui-sfml never reports to ImGui that that key was pressed, because in the past the set of available keys was limited:https://github.com/eliasdaler/imgui-sfml/blob/4129d276d45845581b6ba99ede50db6f761e5089/imgui-SFML.cpp#L284-L291
Here you can observe the missing events: One can just run the default "imgui-demo" and in the current state of imgui-sfml it is missing a lot of information in the "Keyboard, Gamepad & Navigation State".
How I was running this:
c++ -I. -I./imgui examples/minimal/main.cpp imgui-SFML.cpp ./imgui/{imgui_demo.cpp,imgui_widgets.cpp,imgui.cpp,imgui_draw.cpp,imgui_tables.cpp} -lsfml-graphics -lsfml-window -lsfml-system -lGL && ./a.out
And here's how I was running with ImGui's own SDL backend, to be able to compare:
c++ -I. -Ibackends -I/usr/include/SDL2 -lSDL2 -lGL examples/example_sdl_opengl3/main.cpp backends/imgui_impl_opengl3.cpp backends/imgui_impl_sdl.cpp imgui_demo.cpp imgui_widgets.cpp imgui.cpp imgui_draw.cpp imgui_tables.cpp && ./a.out