-
Notifications
You must be signed in to change notification settings - Fork 15.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSX: Expose 3-finger swipe events in browser-window #4843
Conversation
I think we should probably add just one |
@@ -267,6 +267,18 @@ - (void)setEnableLargerThanScreen:(bool)enable { | |||
|
|||
// NSWindow overrides. | |||
|
|||
- (void)swipeWithEvent:(NSEvent *)event { | |||
if (event.deltaY == 1.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use 2 spaces as indention.
Given the deltas will only ever arrive in 4 combinations, should the API just expose a single |
I started rewriting this PR to expose the deltas in the API, then got annoyed with having to reimplement the delta checking at the application level, and thinking about everyone else who would have to do the same. I suspect optimising for a more intuitive API vs exposing the underlying mechanism makes more sense in this case. That said, I agree with collapsing 4 distinct events down to one event with an enum argument; the main reason I didn't initially was to avoid dealing with passing around arguments in the internals. |
I pushed a version with a single |
I'm good with a single |
This adds a new
swipe
event tobrowser-window
for 3-finger trackpad swipes on OS X.#4181 added support for 2-finger scroll events on OS X, which allow apps to handle some forms of back/forward navigation. However, OS X also exposes a
swipeWithEvent
method onNSResponder
for 3-finger swipes, and it's possible to set these as the "Swipe between pages" gesture. These swipes are only directional, with no velocity, so are easily exposed as one-off events. They will only fire if the option is set in System Preferences to Swipe with two or three fingers or Swipe with three fingers