Skip to content

3D view hotkeys (orbit, roll, zoom), settings, About / markdown, tooling, and docs#97

Merged
trailcode merged 10 commits intomainfrom
Trailcode/hot-keys
May 4, 2026
Merged

3D view hotkeys (orbit, roll, zoom), settings, About / markdown, tooling, and docs#97
trailcode merged 10 commits intomainfrom
Trailcode/hot-keys

Conversation

@trailcode
Copy link
Copy Markdown
Owner

@trailcode trailcode commented May 3, 2026

Pull request: Trailcode/hot-keysmain

Summary

Adds keyboard-driven 3D navigation (numpad orbit, shift-based roll with fallbacks, keyboard zoom with repeat), persisted settings for view rotation step and zoom scroll scale (with Shift for finer zoom), Help > About via imgui_markdown and bundled assets, EZY_ASSERT_OR_RETURN helpers in dbg.h, pbf→png scripts, CMake / .gitignore updates, and usage / CHANGELOG updates including Num Lock guidance for the keypad.

Related issues

Issue Link Notes
Hot keys #93 Umbrella / placeholder issue for hotkey work.
View roll, settings, pbf-to-png #95 Describes roll, View roll step / settings JSON, tooling, and docs.
Underlay bug fixes #92 Underlay affine / shear guardrails; branch may include related sketch_underlay / GUI changes—confirm in diff.
Underlay bug fixes (duplicate / follow-up) #96 Same theme as #92 with bug + enhancement labels; use one issue as canonical when closing.
Sketch UX, planar-face pick, … #88 May or may not apply: targets branch Trailcode/b6 in the issue body; only relate if this PR actually contains those commits (verify before linking in “Fixes”).

User-facing changes

  1. Orbit: NumPad 8 / 2 / 4 / 6 (no modifiers), same convention as LMB orbit (Occt_view::orbit_view_screen_step_deg).
  2. Roll: Shift + NumPad 4/6, main 4/6, or Left/Right; supports key repeat while held.
  3. Axis snap: NumPad 5 (nearest orthographic view).
  4. Zoom: NumPad +/-, Shift+=, -; repeat while held; gui.view_zoom_scroll_scale; Shift applies finer step (×0.1).
  5. Settings: View rotation step (gui.view_roll_step_deg) and Zoom scroll scale (gui.view_zoom_scroll_scale); tooltips and usage links.
  6. About: Markdown + splash image path wired in CMake / runtime.
  7. Docs: Num Lock off recommended for reliable numpad shortcuts (usage.md, usage-occt-view.md, usage-settings.md).

Technical highlights

Area Files (representative)
View / input src/occt_view.{h,cpp}, src/gui_mode.cpp, src/gui.cpp, src/gui.h
Settings / JSON src/gui_settings.cpp, res/ezycad_settings.json
Assertions src/dbg.h
About / markdown third_party/imgui_markdown/, res/about.md, src/gui.cpp, CMakeLists.txt
Docs usage.md, usage-occt-view.md, usage-settings.md, CHANGELOG.md
Tooling scripts/pbf-to-png.py, scripts/pbf-to-png.ps1
Consoles src/lua_console.cpp, src/python_console.cpp (settings JSON help text)

Testing checklist

  • Num Lock off: orbit, roll, zoom, axis snap, keypad selection digits (Normal mode).
  • Settings persist: gui.view_roll_step_deg, gui.view_zoom_scroll_scale (save, restart, reload).
  • About dialog: markdown, links, image.
  • Emscripten (if applicable for this release).
    • Has bugs, hot keys are handled on the toolbar.

Note

Medium Risk
Touches core input handling and OCCT camera/zoom behavior, plus settings persistence; regressions could affect navigation feel or key routing across platforms (especially numpad/Num Lock).

Overview
Enables keyboard 3D navigation: numpad orbit (8/2/4/6), axis snap (5), Blender-style roll (Shift+NumPad 4/6 with main-key/arrow fallbacks), and keyboard zoom (NumPad +/-, Shift+=, -) with key-repeat and Shift for finer increments.

Adds new persisted GUI settings gui.view_roll_step_deg and gui.view_zoom_scroll_scale, surfaces them in a new Settings → 3D view navigation section, and wires them into OCCT zoom scaling and keyboard step sizes.

Reworks Help → About into an in-app modal that renders bundled res/about.md (with splash image + clickable links) via vendored third_party/imgui_markdown, and updates CMake packaging/preload to ship the new assets (plus cleans up res/default.ezy). Docs/changelog are updated accordingly, and a small EZY_ASSERT_OR_RETURN* helper macro is added alongside new scripts/pbf-to-png tooling and agent issue drafts.

Reviewed by Cursor Bugbot for commit 26deebb. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 26deebb. Configure here.

Comment thread src/gui_mode.cpp

if (zoom_in)
{
m_view->zoom_view_wheel_notches(1.0, shift_finer);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shift+= zoom always applies finer 0.1x step

High Severity

The GLFW_KEY_EQUAL case requires GLFW_MOD_SHIFT to activate zoom_in (since Shift+= produces + on US keyboards). But shift_finer is also derived from GLFW_MOD_SHIFT, so it's always true when zooming in via this key. This means zoom_view_wheel_notches(1.0, true) always applies the 0.1x finer factor, producing a zoom delta of 1 instead of 4 (with default settings). The main-keyboard zoom-in key is permanently 4x slower than NumPad +, contradicting the docs that say they're equivalent.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 26deebb. Configure here.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment thread src/gui_settings.cpp Outdated
const double v = g["view_roll_step_deg"].get<double>();
EZY_ASSERT_MSG(v >= k_gui_view_roll_step_deg_min && v <= k_gui_view_roll_step_deg_max,
"settings gui.view_roll_step_deg out of range [0.1, 180]");
m_view_roll_step_deg = v;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Settings JSON asserts crash app on out-of-range values

Medium Severity

Loading view_roll_step_deg and view_zoom_scroll_scale from user-editable JSON uses EZY_ASSERT_MSG (which calls DEBUG_BREAK / raise(SIGTRAP)) for range validation instead of silent clamping. Unlike existing settings like edge_dim_line_width which silently reject out-of-range values, an out-of-range value here crashes the app on startup. Additionally, the out-of-range value is still assigned after the assertion fires.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 26deebb. Configure here.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 4, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@trailcode trailcode merged commit c58f213 into main May 4, 2026
1 check passed
@trailcode trailcode deleted the Trailcode/hot-keys branch May 4, 2026 00:10
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