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

SetItemUsingMouseWheel Obsoleted? #5930

Closed
michaelquigley opened this issue Nov 28, 2022 · 3 comments
Closed

SetItemUsingMouseWheel Obsoleted? #5930

michaelquigley opened this issue Nov 28, 2022 · 3 comments
Labels

Comments

@michaelquigley
Copy link

Version: v1.89.1

What happened to SetItemUsingMouseWheel? What's the current mechanism to achieve this in 1.89.1?

    // Obsolete functions
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
    inline void     SetItemUsingMouseWheel()                                            { SetItemKeyOwner(ImGuiKey_MouseWheelY); }      // Changed in 1.89
@michaelquigley
Copy link
Author

According to the above, it looks like I can maintain the functionality using:

ImGui::SetItemKeyOwner(ImGuiKey_MouseWheelY);

Will ImGui maintain this capability going forward? It looks like the SetItemKeyOwner stuff is "experimental"?

@zao
Copy link

zao commented Nov 29, 2022

See #2891 (comment) for some info on this deprecated function and a suggestion to use SetItemKeyOwner as part of the more generic system that replaces it.

@ocornut ocornut added the inputs label Nov 29, 2022
@ocornut
Copy link
Owner

ocornut commented Nov 29, 2022

Also linking to #4207, cross-posting
Everything in imgui_internal.h is technically not guaranteed to be stable, but SetItemKeyOwner() is the way forward.
As SetItemUsingMouseWheel() was mentioned in #5108 #4303 #4207 #2891 #2704 I added a redirection function in imgui_internal.h but those are fairly exceptional and the SetItemUsingMouseWheel() inline function will eventually be removed.

There is a very small change that SetItemKeyOwner() will evolve but either way the feature will be preserved.

@ocornut ocornut closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants