Skip to main content

Module select_mods

Module select_mods 

Source
Expand description

Selection modifiers: Cmd/Ctrl primary, macOS Ctrl+click = secondary, list ranges. Selection modifiers, one meaning on every platform (multi-select rework, owner 2026-11-26).

  • The PRIMARY modifier is Cmd on macOS and Ctrl on Windows/Linux. egui’s Modifiers::command is not enough on its own: the native (egui-winit) runner sets it to Cmd on macOS, but eframe’s WEB runner sets it to ctrl || meta on every OS, so a Mac browser’s Ctrl+click would read as a primary click. On macOS the primary modifier is therefore mac_cmd.
  • On macOS a Ctrl+click is the secondary (right) click, and a Ctrl+drag is a right drag (pan). MacSecondary::rewrite turns those button events into secondary-button events in the raw input, once, before any widget sees them — so every context menu, secondary_clicked() and dragged_by(Secondary) path behaves as it does for a real right button, natively and in the browser build, and Ctrl never adds to a selection.
  • Shift means “more”: in the 3D view Shift+click adds/toggles like the primary modifier; in ordered lists (feature tree, assembly tree, BOM) Shift+click selects the RANGE from the anchor row (range).

Structs§

MacSecondary
The macOS Ctrl+click → secondary click rewrite (see the module docs). One per app: it remembers which presses it turned so their releases match even when Ctrl is let go first.

Enums§

RowClick
How an ordered list row click applies (feature tree, assembly tree, BOM).

Functions§

additive
Whether a click adds to (toggles in) the 3D selection: the primary modifier or Shift.
primary
Whether the PRIMARY modifier (Cmd on macOS, Ctrl elsewhere) is held.
primary_in
primary for the context’s OS.
range
The rows from anchor to clicked inclusive, in display order, or None when either is not in rows (the anchor row is gone: the caller selects the clicked row alone).
rewrite_raw
Apply MacSecondary::rewrite to a frame’s raw input, keeping its state in the context (one per window). Every host calls it after its own input is in raw: the app’s raw_input_hook and the headless MCP host.