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
Support for multi-touch gestures on OS X #1486
Comments
I think Chrome 42 which is used by latest Electron already has some support of it. |
I'm unable to find any information about it. Can you provide some source? |
This will probably be implemented as Touch events, right? |
@petrbrzek "multi-touch gestures" is a too general topic, can you say more specific about what you want? |
@petrbrzek For that part of APIs I think you have to wait until Chrome supports some HTML5 standards on touch events, exposing them in JS is huge work and it is not practically to implement them alone in Electron. |
Can you use a JS touch library? http://hammerjs.github.io/ |
@mandric unfortunately no. Those touch events that hammerjs relies on aren't fired on desktop when using the trackpad. Only on mobile. |
@petrbrzek Chrome already supports touch events on mobile and desktops with touch screens. It just doesn't recognize trackpad gestures. Also, I believe trying tying into the OS-supported trackpad gestures is a different task than dealing with touch events. |
In N1, we want to implement the famous "swipe to archive" action on threads in the user's inbox. Chrome exposes `scroll` and `wheel` events, but these aren't sufficient to implement the interaction because the element needs to "snap" when the user lifts their fingers from the trackpad, not when they / we stop receiving `wheel` / `scroll` events. These events may stop before the user lifts their fingers, or continue after the user has lifted their fingers if they had enough momentum for the gesture to continue. This exposes BrowserWindow `scroll-touch-down` and `scroll-touch-up`, which fire immeditaely when the user touches two fingers to the trackpad, and again when the user lifts their fingers. Combined with the existing wheel event should allow for "swipe-to-archive" and other similar interactions. Note: This is only implemented on Mac OS X and the events don't fire unless you're using a trackpad! Related: electron#1486, electron#2683, nylas/nylas-mail#541
Why was this closed? Has the issue been fixed? |
Its non trivial to add and only supported on Mac. Check out the discussion here over why this hasn't been added to Chrome. |
Btw, pinch-zoom events come through in electron as standard JavaScript |
I see that 3-finger swipe gestures are already supported: https://electronjs.org/docs/api/browser-window#event-swipe-macos But is there a way to easily detect 2-finger swipe gestures, similar to what Chrome & Safari on mac use for Back/Forward navigation? |
Any news on this issue? |
Any updates? |
I am experiencing similar problems with 2 finger gestures on electron when running in Linux. |
Any updates? |
For folks looking for support for two-finger swipe navigation: #2683 |
No description provided.
The text was updated successfully, but these errors were encountered: