Skip to content

Fix: enable pinch-to-zoom on precision touchpads#29

Open
andrewtheart wants to merge 1 commit into
FrozenAssassine:masterfrom
andrewtheart:fix/precision-touchpad-pinch-zoom
Open

Fix: enable pinch-to-zoom on precision touchpads#29
andrewtheart wants to merge 1 commit into
FrozenAssassine:masterfrom
andrewtheart:fix/precision-touchpad-pinch-zoom

Conversation

@andrewtheart

Copy link
Copy Markdown

What

Enables pinch-to-zoom on precision touchpads, which currently does nothing.

Why

PointerActionsManager.PointerWheelAction gates the zoom branch on Utils.IsKeyPressed(VirtualKey.Control). A precision-touchpad pinch is delivered by Windows as a Ctrl-modified mouse-wheel message, but that Control flag rides on the wheel event (PointerRoutedEventArgs.KeyModifiers) and is not reflected in the physical keyboard state that Utils.IsKeyPressed reads. So pinching a precision touchpad falls through to the scroll branch and never zooms.

Change

Also check e.KeyModifiers.HasFlag(VirtualKeyModifiers.Control) in the zoom condition. Physical Ctrl+wheel keeps working exactly as before; pinch now zooms too.

Testing

  • Builds clean (TextControlBox.csproj, Release/x64).
  • Ctrl+mouse-wheel zoom: unchanged. Precision-touchpad pinch: now zooms.

Contributing this back upstream after hitting it while using TextControlBox as a vendored editor.

PointerWheelAction only checked the physical keyboard Ctrl state (Utils.IsKeyPressed) to decide whether a wheel event is a zoom gesture. A precision-touchpad pinch arrives as a Ctrl-modified wheel where the Control flag is on the event's KeyModifiers, not the keyboard state, so pinch gestures were ignored. Also check e.KeyModifiers.HasFlag(VirtualKeyModifiers.Control).
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