Disable or Change <Shift> Key for Multi-Select

Hi Walter,

is it possible to really deactivate Multi-Select (not by restricting multi-selection to 1), or to change Key affected to Multi-Select?

Regard

JJ

Here’s the definition of DiagramTool.StandardMouseSelect:

    protected virtual void StandardMouseSelect() {
      Diagram diagram = this.Diagram;
      if (diagram == null || !diagram.AllowSelect) return;
      Part currentPart = FindPartAt(diagram.LastMousePointInModel, true);

      bool control = IsControlKeyDown();
      bool shift = IsShiftKeyDown();
      bool left = IsLeftButtonDown();
      if (currentPart != null) {
        if (control) {  // toggle the part's selection
          currentPart.IsSelected = !currentPart.IsSelected;
        } else if (shift) {  // add the part to the selection
          if (!currentPart.IsSelected) {
            currentPart.IsSelected = true;
          }
        } else {
          if (!currentPart.IsSelected) {
            diagram.Select(currentPart);
          }
        }
      } else if (left && !control && !shift) {  // left click on background with no modifier: clear selection
        diagram.ClearSelection();
      }
    }

I’m not sure exactly which tools you want to modify the selection behavior. You probably at least want to modify the behavior of ClickSelectingTool. But I suggest that for each of the tools that you want to modify, override this StandardMouseSelect method to do what you want.

Hi Walter,

This is exactly what I was looking for. Shift key is used for another purpose as “add the part to the selection”

Thanks

JJ