harshadgavali / gnome-gesture-improvements

Touchpad gesture improvements for GNOME on Wayland/X11
https://extensions.gnome.org/extension/4245/gesture-improvements/
GNU General Public License v3.0
330 stars 38 forks source link

Request: Three Finger Gestures for Forward/Back #23

Closed LawrenceMaceren96 closed 2 years ago

LawrenceMaceren96 commented 2 years ago

I would love to have an option for three figure gestures left/right to be forward/back in browsers and other windows. I personally have it follow natural scrolling (swiping right goes back, swiping left goes forward), but I imagine others would like to have a toggle to switch between natural scrolling too.

An option to select gestures for three finger gestures (selecting window switching, or forward/back) would be great! Selecting gestures for 4 finger gestures too may be nice if other users would like that too.

AchimStuy commented 2 years ago

I'd love that feature, too.

Extended Gestures solves it by sendKeyEvent(Clutter.KEY_Forward)

harshadgavali commented 2 years ago

I'll try to implement it for next version, It'll take some time to learn how to do animation similar to what chromium based browsers do on X11 for this feature.

Instead of just 3 finger gesture, I might use hold gestures or just provide option for both.

zilexa commented 2 years ago

+1 for this although I believe on Safari/MacOS Apple uses 2 finger gestures for this. Not sure what happens on a 'wide' webpage when you can scroll both vertically and horizontally.

If it doesn't interfere with horizontal scrolling, it would not matter to me if it is done via 2-finger or 3-finger gestures.

PS: I really love the fact I only had to install your extension - no configuration needed - to switch the system default gestures from 3 to 4 fingers :) At least on Manjaro Gnome. That was exactly what I was looking for.

TeoColuccio commented 2 years ago

+1 and and I think it's a 2 finger gesture too like the previous answer.

AchimStuy commented 2 years ago

My PR is without the animation, but a beginning.

Instead of just 3 finger gesture, I might use hold gestures or just provide option for both.

What would user experience be like? What I understand from hold gestures, they are triggered, when fingers are on the touchpad without moving. So how would you distinguish between whether the user wants forward or back?

AchimStuy commented 2 years ago

Also, can you please show me Chromium's animation on X11? Maybe I can add one, too..

harshadgavali commented 2 years ago

Also, can you please show me Chromium's animation on X11? Maybe I can add one, too.. I have those in local branch, I’ll add them after MR is completed.

by hold gestures I meant hold and then swipe (which won’t be available till GNOME 42 anyway).

pavethem commented 2 years ago

I'm running the Wip/show desktop branch here on wayland and the gestures are working great. However, the directions of the gestures seem to be flipped, i.e. a right gestures goes backwards whereas it should go forward. Also, how about adding an option for window switiching via a vertical three-finger gesture? That way users don't have to choose between switching windows and navigating their browsers. Keep up the great work!

harshadgavali commented 2 years ago

I'm running the Wip/show desktop branch here on wayland and the gestures are working great. However, the directions of the gestures seem to be flipped, i.e. a right gestures goes backwards whereas it should go forward. That's expected behaviour, right?

GNOME Web, Chromium on X11 operates in same manner. I think terminology is like this, swipe to right brings previous page forward. similarly swipe to left brings next page back.

Also, how about adding an option for window switiching via a vertical three-finger gesture? That way users don't have to choose between switching windows and navigating their browsers.

Thanks for idea @pavethem . I'll keep this in mind, I also don't want to disable one gesture in favor of other. I have currently implemented via hold and swipe gesture in wip/hold-gesture-forward-back branch (hold gestures are only available on X11 for now, so WIP). So altab is available using normal swipe and forward-back using hold and then swipe. If you can test, let me know if default delay is good enough for too fast/slow.

pavethem commented 2 years ago

Can't test right now unfortunately. Fwiw, I've been using three-finger horizontally for back-and-forwards and three-finger vertically for cycling windows for a long time using touchegg and it works really well. Of course both actions are implying a horizontal gesture (the forward and backward buttons of the browser, and the layout of the alt+tab switcher being horizontal), but I still think adding a vertical gesture would make these actions less ambiguous, as opposed to executing everything by means of horizontal gestures. Doesn't the user already kind of have to hold their fingers down in order to get the application switcher to show up? Anyways, thank you for your work and I'm looking forward to checking out the branch when I can.

diegodario88 commented 2 years ago

Hey thanks for putting effort on this feature I would love to see this working on Gnome 42. Is there a way to test or help you somehow?

AdnanHodzic commented 2 years ago

+1, having ability to go back/forward using 3 fingers swipe gesture would be great!

diegodario88 commented 2 years ago

I was able to merge wip/hold-gesture-forward-back into main for testing on Gnome 4.2 Wayland and for browser and folder navigation it's working so far. It would be great if I could use this gesture on Gnome Calendar and Gnome Photos, can someone point me some directions so I can play arround?

diegodario88 commented 2 years ago

I was able to merge wip/hold-gesture-forward-back into main for testing on Gnome 4.2 Wayland and for browser and folder navigation it's working so far. It would be great if I could use this gesture on Gnome Calendar and Gnome Photos, can someone point me some directions so I can play arround?

keyboard.sendKeys(Clutter.KEY_Alt_L, Clutter.KEY_{DIRECTION}); did the trick

harshadgavali commented 2 years ago

Hi all, thanks for patience and thanks @AchimStuy for PR for this feature.

I have updated and added preference for it, so different shortcuts can be triggered for different applications. Here's how preference page looks like. Screenshot from 2022-04-18 19-37-27

There was one issue on wayland where shortcut to change tab wasn't recognised by some applications. But I have added some delay for it to work.

zilexa commented 2 years ago

May I suggest Nemo file manager and perhaps document viewer apps?

diegodario88 commented 2 years ago

Hi all, thanks for patience and thanks @AchimStuy for PR for this feature.

I have updated and added preference for it, so different shortcuts can be triggered for different applications. Here's how preference page looks like. Screenshot from 2022-04-18 19-37-27

There was one issue on wayland where shortcut to change tab wasn't recognised by some applications. But I have added some delay for it to work.

  • Can you test and confirm if all shortcuts work and whether gesture works for other apps as well?
  • Also can you suggest more applications and keyboard shortcuts combination to set as defaults?

    • e.g., Right/Left arrow keys for GNOME Photos.

    For testing on GNOME42

  • Download zip from github actions
  • Run
unzip gestureImprovements.2022-04-18.e96ab6f@gestures.shell-extension.zip.zip 
gnome-extensions install -f gestureImprovements@gestures.shell-extension.zip 
  • Log out and log in

Yep, can confirm it's working and the way you solve this was brilliant 🥇

Thank you @harshadgavali

harshadgavali commented 2 years ago

May I suggest Nemo file manager and perhaps document viewer apps?

Can you name document viewer app and it's keyboard shortcut? Also does nemo use different shortcuts compared to nautilus? If not default shortcuts(Forward/Backward) will work even if app wasn't added to list (I added this message in recent commit).

harshadgavali commented 2 years ago

Thank you all, it's now available on extensios website.