Skip to content

Share vernier keyboard bindings via HotkeyData #4

Description

@veillette

Summary

Spawned from Code Review #1 (Accessibility / keyboard help).

VernierScaleNode and CaliperNode each register a KeyboardListener with inline string keys (arrowRight, pageUp, …). VernierKeyboardHelpSection rebuilds the same shortcuts with KeyboardHelpIconFactory icons. They are not linked through HotkeyData + KeyboardHelpSectionRow.fromHotkeyData.

Expected (per scenerystack-keyboard-help-dialog / CRC)

Define bindings once as HotkeyData, use them in the listeners, and build help rows with fromHotkeyData so documentation cannot drift from behavior.

Also: the duplicated switch (keysPressed) bodies in VernierScaleNode and CaliperNode can collapse onto one shared helper once HotkeyData exists.

References

  • src/common/view/VernierScaleNode.ts (addDragTarget)
  • src/caliper/view/CaliperNode.ts (slider keyboard listener)
  • src/common/view/VernierKeyboardHelpSection.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions