Skip to content

Add an event filter to allow general Ctrl+arrow use for nav - #855

Merged
ghutchis merged 1 commit into
OpenChemistry:masterfrom
ghutchis:fix-add-navigation-filter
Sep 7, 2026
Merged

Add an event filter to allow general Ctrl+arrow use for nav#855
ghutchis merged 1 commit into
OpenChemistry:masterfrom
ghutchis:fix-add-navigation-filter

Conversation

@ghutchis

@ghutchis ghutchis commented Sep 6, 2026

Copy link
Copy Markdown
Member

Checks to make sure it's not in a text area

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Summary by CodeRabbit

  • New Features
    • Camera navigation shortcuts using Ctrl/Cmd plus arrow keys now work even when focus is elsewhere in the application window.
    • Text-entry fields retain their normal keyboard behavior, preventing shortcuts from interfering with editing.

Checks to make sure it's not in a text area

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
@ghutchis

ghutchis commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 6434ed9c-614c-4912-a66c-36053bda6086

📥 Commits

Reviewing files that changed from the base of the PR and between b1e3fec and 35127bf.

📒 Files selected for processing (2)
  • avogadro/mainwindow.cpp
  • avogadro/mainwindow.h

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

MainWindow now installs an application-wide event filter. The filter recognizes Ctrl/Cmd arrow shortcuts, excludes text-entry widgets and Ctrl+Shift combinations, and forwards eligible events to the active GLWidget.

Changes

Navigation shortcut routing

Layer / File(s) Summary
Filter declaration and registration
avogadro/mainwindow.h, avogadro/mainwindow.cpp
MainWindow declares eventFilter, includes the required Qt event and widget types, and installs itself as the application event filter.
Shortcut filtering and forwarding
avogadro/mainwindow.cpp
eventFilter validates navigation shortcuts, preserves text-entry behavior, claims ShortcutOverride events, and forwards eligible key events to the active GLWidget.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 35127

Ctrl/Cmd-arrow navigation is now routed to the active GL widget outside text-entry controls, while text editing shortcuts remain unaffected. No concrete merge-blocking risk remains.

Poem

A rabbit hops where arrow keys glide
Ctrl and Cmd now guide the ride
Text boxes keep their quiet place
GLWidget catches the chase
Events spring softly, side to side

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding an event filter to support Ctrl+arrow navigation shortcuts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ghutchis
ghutchis merged commit 8534607 into OpenChemistry:master Sep 7, 2026
15 of 19 checks passed
@ghutchis
ghutchis deleted the fix-add-navigation-filter branch September 7, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant