Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ImGui IO event API #23

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

New ImGui IO event API #23

wants to merge 10 commits into from

Conversation

jonpas
Copy link
Member

@jonpas jonpas commented Feb 24, 2024

This pull request reworks the Unreal backend for ImGui to use the new IO event API introduced in ImGui 1.87.

Most of the intermediate storage has been removed in this project as core ImGui now handles it correctly even at low framerates. Certain missing keybinds have been added (such as Super/Command).

It is advisable for users of this project to thoroughly review and test this before it is merged.

@jonpas jonpas added the enhancement New feature or request label Feb 24, 2024
@dyanikoglu
Copy link

Is this properly tested? I gave it a try but keyboard & gamepad navigations both not working anymore after applying the diff.

@@ -92,6 +92,7 @@ FImGuiContextProxy::FImGuiContextProxy(const FString& InName, int32 InContextInd

// Start initialization.
ImGuiIO& IO = ImGui::GetIO();
InputState.IO = IO;
Copy link

@dyanikoglu dyanikoglu Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, you're copying the global IO struct. Instead, I recommend storing IO in InputState as a pointer. Otherwise, this causes IO to not work at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't seem to be correct. ImGui::GetIO() returns a reference, we are just storing that reference. IO works.

@jonpas
Copy link
Member Author

jonpas commented Dec 13, 2024

This will be required to update imgui above v1.91.4. Help would be appreciated.

@jonpas
Copy link
Member Author

jonpas commented Jan 14, 2025

This is functional for mouse and keyboard on a demo UI. Gamepad still to be tested.

Mouse capture debug commit above also happens on current master, so it is unlikely to be included in this PR. We will track it in #9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants