hoffstadt/DearPyGui

support for WantCaptureMouse

jacobnrohan opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
Loving DearPyGui, but it appears to have no support for "WantCaptureMouse". This variable is described in the ocornut/imgui repo:
"Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.)."

Describe the solution you'd like
A method to access this variable would be helpful. A callback that occurs when this value changes would also be helpful, though not as important.

Additional context
Feature does not appear in the dpg.demo.show_demo(), but appears in the dpg.show_imgui_demo():
Screenshot from 2024-02-11 16-04-12_edit

Hardly a good solution at all, but this is what I'm using currently:

hovered = []
for window in dpg.get_windows():
    state = dpg.get_item_state(window)
    if "hovered" in state.keys():
        hovered += [state["hovered"]]
any_hovered = any(hovered)

which is equivalent to:
any_hovered = any([s["hovered"] for s in [dpg.get_item_state(w) for w in dpg.get_windows()] if ("hovered" in s.keys())])

This method does not support callbacks and often acts buggy when interacting with some widgets.