Possible mouse_released_fn bug

The code below prints a message each time the mouse wheel or right button is released anywhere in Kit, including over other windows and the viewport:

import omni.ui as ui

_window_example = ui.Window("Example Window", width=300, height=300)

with _window_example.frame:
  with ui.VStack():
    ui.Spacer()
    ui.Label("Label",  mouse_released_fn=lambda x,y,b,m: print("Label released"))
    ui.Button("Button", mouse_released_fn=lambda x,y,b,m: print("Button released"))
    ui.Spacer()

Other handlers like mouse_pressed_fn don’t exhibit this behavior.

By the way, is there any other channel to report bugs, other than this forum?

Thanks

Hi @jordio. From my testing of your repro, it seems that it prints for any click that originates from the widget. This is what I observed:

  1. If I press on the button and release on the button, it prints.
  2. If I press on the button and release off the button, it prints.
  3. If I press off the button and release on the button, it DOES NOT print.

This seems like the correct behavior to me and it is consistent with our docstring:

`clicked_fn : Callable[[], None]`
                Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).

`mouse_pressed_fn : Callable`
                Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: 'button' is the number of the mouse button pressed. 'modifier' is the flag for the keyboard modifier key.

`mouse_released_fn : Callable`
                Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

Let me know if you are seeing something different.

You can also submit bugs to our ServiceDesk portal which is a more private option: Jira Service Management. I’ll likely still be the first to triage it. :)

Hi @mati-nvidia. Exactly, this would not be a problem if it only happened on clicks over the button or label, which is the intended behavior.

But in code-2022.1.3 it prints on clicks all over the UI: on the viewport, stage inspector and everywhere else.

I’ve attached a video that shows the problem.

@jordio. You’re right. I missed the middle and right click detail. I’ve logged OM-60768 for this bug. Thanks for reporting it!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.