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

Fixes for ImGuiModFlags_XXX -> ImGuiMod_XXX (v1.89) (#347) #407

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

ocornut
Copy link
Collaborator

@ocornut ocornut commented Sep 26, 2022

This is a followup to #347 and an update following this change in core lib:
ocornut/imgui@fd408c9

Like with #347 this is only required for users building with IMGUI_DISABLE_OBSOLETE_FUNCTIONS + aiming to support a few older versions.


If you don't mind raising minimum imgui version to latest, you can start taking advantage of the fact that ImGuiMod_XXX values can be safely or-ed with an ImGuiKey, so stuff like:

ImGuiMouseButton Pan;           // LMB    enables panning when held,
ImGuiModFlags    PanMod;        // none   optional modifier that must be held for panning/fitting

Could become:

ImGuiKeyChord Pan;    // == ImGuiKey_MouseLeft | ImGuiMod_Ctrl

(adding Ctrl for the example but PanMod default to None).

I would however suggest not making those changes yet, wait until at least 1.89 releases.

@epezent
Copy link
Owner

epezent commented Sep 29, 2022

Nice! I'll have to look into this and see if it's worth raising the min version (my hunch is not right now, but maybe in the future). Thanks for the PR!

@epezent epezent merged commit 626e391 into epezent:master Sep 29, 2022
@ocornut ocornut deleted the fix_for_v189_key_mods branch April 17, 2023 13:24
Ben1138 pushed a commit to Ben1138/implot that referenced this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants