napari_track_edit.data_views.views.layers.click_utils ===================================================== .. py:module:: napari_track_edit.data_views.views.layers.click_utils Attributes ---------- .. autoapisummary:: napari_track_edit.data_views.views.layers.click_utils.QT_BUTTON_TO_INT Functions --------- .. autoapisummary:: napari_track_edit.data_views.views.layers.click_utils.detect_side_button napari_track_edit.data_views.views.layers.click_utils.detect_click napari_track_edit.data_views.views.layers.click_utils.wait_for_release napari_track_edit.data_views.views.layers.click_utils.get_click_value Module Contents --------------- .. py:data:: QT_BUTTON_TO_INT .. py:function:: detect_side_button(event: napari.utils.events.Event | qtpy.QtGui.QMouseEvent) -> int | None Detect if a mouse side button (back/forward) was pressed. :param event: The napari mouse event or a Qt QMouseEvent :returns: back, 5: forward), or None if not a side button :rtype: MouseButton integer (4 .. py:function:: detect_click(event: napari.utils.events.Event) -> collections.abc.Generator[None, None, bool] Yield during drag, then return True if this was a click. .. py:function:: wait_for_release(event: napari.utils.events.Event) -> collections.abc.Generator[None, None, None] Yield until the mouse button is released. Use this in a mouse drag callback before anything that may open a modal dialog (such as confirm_force_operation): a dialog opened while the button is still pressed takes the mouse release away from the canvas, which leaves napari and vispy in a 'button pressed' state and the viewer unresponsive to clicks. .. py:function:: get_click_value(layer: napari.layers.Labels | napari.layers.Points, event: napari.utils.events.Event) -> int Return the value (label, point index) at the click location