Skip to content

Add Shift+Scroll horizontal scrolling#1090

Open
saberoueslati wants to merge 1 commit into
dail8859:masterfrom
saberoueslati:feature/742-shift-scroll-horizontal
Open

Add Shift+Scroll horizontal scrolling#1090
saberoueslati wants to merge 1 commit into
dail8859:masterfrom
saberoueslati:feature/742-shift-scroll-horizontal

Conversation

@saberoueslati

Copy link
Copy Markdown
Contributor

Description

Fixes #742

Qt does not consistently translate Shift+Scroll into horizontal scrolling. This PR extends the existing editor wheel-event watcher to provide that behavior while preserving Ctrl+Scroll zoom and existing horizontal wheel input.

It also prevents accidental primary-selection pastes caused by the physical scroll wheel occasionally registering as a middle-button press while Shift is held.


Changes

src/ZoomEventWatcher.cpp

  • Extended the existing viewport event filter to handle Shift+Scroll.
  • Transposes vertical angle and pixel deltas into horizontal deltas.
  • Preserves events that already arrive horizontally instead of transposing them again.
  • Removes the Shift modifier before forwarding the event, preventing Qt from treating it as a page-sized scrollbar movement.
  • Preserves the original scroll phase, inversion state, event source, and pointing device.
  • Keeps Ctrl+Scroll and Ctrl+Shift+Scroll mapped to zoom.
  • Suppresses Shift+middle-button presses before they reach Scintilla, preventing accidental Linux/X11 primary-selection pastes while beginning horizontal scrolling.
  • Leaves regular middle-click paste without Shift unchanged.

src/dialogs/MainWindow.cpp

  • Updated the existing viewport event-filter comment to document both zoom handling and Shift+Scroll translation.
  • The existing watcher remains installed on every editor viewport, including editors in split views.

No new setting or preference is required, and no vendored Scintilla files are modified.

Manual test after changes below :

Screencast.from.2026-07-13.00-12-51.webm

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.

Implement Shift+Scroll horizontal scrolling

1 participant