MLightCAD
    Preparing search index...

    Function resolveSelectionActionFromEvent

    • Resolves the selection action implied by the current modifier-key state.

      Precedence is evaluated in the following order:

      1. Shift returns 'remove'.
      2. Ctrl or Meta returns 'add'.
      3. If no modifier is active, defaultAction is returned.

      This lets different call sites share the same modifier semantics while still choosing their own non-modified default, such as 'replace' for generic selection flows or 'add' for pointer interactions that should preserve the existing selection set.

      Parameters

      Returns AcEdSelectionAction

      The normalized selection action to apply.

      resolveSelectionActionFromEvent(
      { shiftKey: false, ctrlKey: false, metaKey: false },
      'replace'
      )
      // => 'replace'
      resolveSelectionActionFromEvent({
      shiftKey: true,
      ctrlKey: false,
      metaKey: false
      })
      // => 'remove'