Skip to content

Shift-click works in pan and zoom mode too - #20

Merged
DavidSagan merged 1 commit into
mainfrom
shift-click-any-mode
Nov 7, 2026
Merged

DavidSagan merged 1 commit into
mainfrom
shift-click-any-mode

Conversation

@DavidSagan

Copy link
Copy Markdown
Member

Summary

Shift-clicks now also work while Pan or Zoom is active in a plot window. They select the element, and on a lattice layout or a floor plan they open its attribute window.

  • How: in Pan or Zoom mode matplotlib uses the mouse press to start a drag, so a shift-click is now handled on release. It counts only if the mouse moved no more than 3 px between press and release.
  • Drags: a shift-drag still pans or zooms and opens nothing.
  • Side effects: none. matplotlib ignores a zoom "rectangle" or pan of under 5 px, so a shift-click doesn't change the view.
  • Plain clicks: they still do nothing in Pan or Zoom mode, as before.

README "Selecting elements" updated.

Testing

  • 55 tests pass and 1 is skipped, locally (twice) and against the conda-forge Tao used in CI.
  • The floor-plan test now checks both zoom and pan mode with real Qt mouse events: a plain click opens nothing, a shift-click opens QF's window, and a shift-drag opens nothing.
  • The test now finds QF's position from the current plot each time. Editing K1 and zooming redraw the plot, so the old position was stale.

🤖 Generated with Claude Code

In pan or zoom mode matplotlib uses the press to start a drag, so a
shift-click is now taken on release, when the mouse has not moved more
than 3 px. A shift-drag still pans or zooms and opens nothing; plain
clicks in those modes still do nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidSagan
DavidSagan merged commit 8ac3bc2 into main Nov 7, 2026
2 checks passed
@DavidSagan
DavidSagan deleted the shift-click-any-mode branch November 7, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant