Skip to content

Keyboard shortcuts for map view: zoom (+/-) and Home (center active boat) #149

Description

@rolker

Part of #143.

Keyboard shortcuts for common view/navigation actions in the CAMP map, requested in
the #143 usability wishlist (item 3). Scope is deliberately limited to non-destructive
view actions; command/control shortcuts (hover, standby, manual/autonomous, abort) are
out of scope here and will be tracked separately with input guards, since binding
boat commands to bare keypresses on an autonomous vessel is a safety concern.

Shortcuts

  • Zoom in+, =, and numpad +
  • Zoom out- and numpad -
  • Home — center the map on the active boat

Binding = (and numpad) alongside + avoids requiring Shift for zoom-in on US keyboards.

"Active boat" semantics

The active platform is whichever platform tab is selected in the Platform Manager —
the existing AutonomousVehicleProject::activePlatform() concept. With multiple platforms
tracked, the operator selects the active one by selecting its tab. This matches the
"active boat = selected tab" definition shared with the lat/lon readout in #148.

Implementation hooks (verified in source)

  • Zoom: ProjectView::wheelEvent already zooms via scale(0.8,0.8) / scale(1.25,1.25).
    Reuse the same factors from key handling so keyboard and wheel zoom match. ProjectView
    has no keyPressEvent today.
  • Center: ProjectView::centerMap(QGeoCoordinate) already centers on a geo position.
    The active platform's live position is available via MainWindow::activePlatformPosition
    (and activePlatform()). Home → fetch active platform position → centerMap(), with a
    no-op guard when there is no active platform (mirror the if(p) guard in sendHover/sendGoto).
  • Registration: use application-level shortcuts (e.g. Qt::ApplicationShortcut) so
    zoom/Home work regardless of which panel currently has focus, not only when the map view
    is focused.

Out of scope (follow-ups)

  • Continuous follow-vehicle mode (there is a commented-out follow_vehicle look-at hook)
    — a toggle distinct from one-shot Home centering.
  • Command/control shortcuts (hover / standby / manual-autonomous / abort) with guards.
  • User-remappable keymap (start with a fixed mapping; revisit if operators want remapping).

Authored-By: Claude Code Agent
Model: Claude Opus 4.8 (1M context)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions