From 563d3f5974ef69aa9c6a2a95fca13e3ed90a5776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= <38459088+jo-mueller@users.noreply.github.com> Date: Fri, 20 Oct 2023 10:33:47 +0200 Subject: [PATCH] overwrite existing key bindings --- src/napari_segment_anything/_widget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/napari_segment_anything/_widget.py b/src/napari_segment_anything/_widget.py index 39bb379..e8093d9 100644 --- a/src/napari_segment_anything/_widget.py +++ b/src/napari_segment_anything/_widget.py @@ -93,8 +93,8 @@ def __init__(self, viewer: napari.Viewer, model_type: str = "default"): self._logits: Optional[torch.TensorType] = None self._model_type_widget.changed.emit(model_type) - self._viewer.bind_key("C", self._on_confirm_mask) - self._viewer.bind_key("X", self._cancel_annot) + self._viewer.bind_key("C", self._on_confirm_mask, overwrite=True) + self._viewer.bind_key("X", self._cancel_annot, overwrite=True) def _load_model(self, model_type: str) -> None: self._sam = sam_model_registry[model_type](