Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Undo axes flip on Mac when shift+scroll-wheel - #38338

Merged
auto-submit[bot] merged 11 commits into
flutter-team-archive:mainfrom
Piinks:undoMacWheel
Jan 10, 2023
Merged

auto-submit[bot] merged 11 commits into
flutter-team-archive:mainfrom
Piinks:undoMacWheel

Conversation

@Piinks

@Piinks Piinks commented Dec 15, 2022 •

Copy link
Copy Markdown
Contributor

Part of flutter/flutter#75180
Follow up PR in flutter/flutter#115610

This un-does some Mac magic wherein holding shift while scrolling a physical mouse wheel automatically flips the axes of the scrolling input. This would normalize the input to the framework across all platforms so we can expose it to developers to configure as they like. I have tried to find any other kind of signal or flag to determine that Mac is doing this, but have not found any.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@Piinks

Piinks commented Dec 15, 2022

Copy link
Copy Markdown
Contributor Author

Based on your experience here @moffatman I am just curious, are you aware of any flag (NSEvent, CGEvent or otherwise) that would tell us Mac is flipping the axes? I've looked high and low and have not found anything, didn't know if you might have an idea.

@Piinks Piinks changed the title Undo mac wheel Undo axes flip on Mac when shift+scroll-wheel Dec 15, 2022
@moffatman

Copy link
Copy Markdown
Contributor

I don't think there is any flag. It must be somewhere inside UIKit that does the flipping. I looked at the CGEvent stream, it's the pre-flip values, and in NSEvent delivered to the application, it's post-flip.

@Piinks

Piinks commented Dec 16, 2022

Copy link
Copy Markdown
Contributor Author

CGEvent stream, it's the pre-flip values, and in NSEvent delivered to the application

Yeah I thought I might be able to find some info to compare in the CGEvent ref but it was already flipped. Thanks so much for taking the time to look.

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A couple of suggestions below, but FWIW this LGTM based on all the device investigation you've done. I'll leave final approval to cbracken though.

@cbracken cbracken left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great!

LGTM stamp from a Japanese personal seal

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 9, 2023
@kevmoo

kevmoo commented Jan 10, 2023

Copy link
Copy Markdown
Contributor

axes or axis?

@Piinks

Piinks commented Jan 10, 2023

Copy link
Copy Markdown
Contributor Author

axes or axis?

Axes - plural of axis, or axiis. :)
Both X & Y flip, not just Y.

@kevmoo

kevmoo commented Jan 10, 2023

Copy link
Copy Markdown
Contributor

Axes - plural of axis, or axiis. :) Both X & Y flip, not just Y.

#TIL!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 10, 2023
auto-submit Bot pushed a commit to flutter/flutter that referenced this pull request Jan 10, 2023
* b6720a5 Undo axes flip on Mac when shift+scroll-wheel (flutter-team-archive/engine#38338)

* 4f0cdcd Inline usage of SkIsPow2 (flutter-team-archive/engine#38722)

* 716bb91 [Impeller Scene] Add DisplayList OP and Dart bindings (flutter-team-archive/engine#38676)
esouthren pushed a commit to esouthren/flutter that referenced this pull request Jan 15, 2023
…8220)

* b6720a5 Undo axes flip on Mac when shift+scroll-wheel (flutter-team-archive/engine#38338)

* 4f0cdcd Inline usage of SkIsPow2 (flutter-team-archive/engine#38722)

* 716bb91 [Impeller Scene] Add DisplayList OP and Dart bindings (flutter-team-archive/engine#38676)