iberianpig / fusuma

Multitouch gestures with libinput driver on Linux
MIT License
3.58k stars 146 forks source link

browser forward and backward #308

Closed luyanfeng closed 7 months ago

luyanfeng commented 10 months ago

Can it support two finger operations, such as browser forward and backward

iberianpig commented 10 months ago

There are no plans to support it in fusuma. It should be implemented on browser side. I think that implementing this naively would make it is not useful. For example, if it hijacked horizontal scrolling, it will not possible to scroll on whiteboard tools in browser. Is it good user interface?

IceAsteroid commented 9 months ago

@luyanfeng In firefox and under wayland, it has been able to toggle backward/forward by two finger swiping gestures natively, by default.

luyanfeng commented 9 months ago

@luyanfeng In firefox and under wayland, it has been able to toggle backward/forward by two finger swiping gestures natively, by default.

I don't know what the problem is, but I tried it under Wayland and found that both Firefox and Chrome were not working

smileBeda commented 7 months ago

This is possible using syngestures, see https://github.com/mqudsi/syngesture You can use this config:

[[device]]
device = "/dev/input/by-path/pci-0000:04:00.1-usb-0:5:1.2-event-mouse"#ADJUST AS NEEDED FOR YOUR CASE
gestures = [
    # Navigate next
    { type = "swipe", direction = "right", fingers = 2, execute = "xdotool key alt+Left" },
    # Navigate previous
    { type = "swipe", direction = "left", fingers = 2, execute = "xdotool key alt+Right" },
]

It does not hijack anything, since a navigation is a fast swipe and a scroll is a slow movement. Entirely different things on a proper clickpad.

The above works in most windows (surely in all browsers), including nautilus, discord app, etc.

iberianpig commented 7 months ago

Thank you, smileBeda, for suggesting the use of syngestures. I'm planning to try it out for the two-finger gestures for browser forward and backward navigation. Based on how well it works, I'll reconsider implementing this feature in Fusuma. Your suggestion seems very helpful. I might share feedback on the user experience after trying it out. Thanks again for your support.

luyanfeng commented 7 months ago

This is possible using syngestures, see https://github.com/mqudsi/syngesture You can use this config:

[[device]]
device = "/dev/input/by-path/pci-0000:04:00.1-usb-0:5:1.2-event-mouse"#ADJUST AS NEEDED FOR YOUR CASE
gestures = [
  # Navigate next
  { type = "swipe", direction = "right", fingers = 2, execute = "xdotool key alt+Left" },
  # Navigate previous
  { type = "swipe", direction = "left", fingers = 2, execute = "xdotool key alt+Right" },
]

It does not hijack anything, since a navigation is a fast swipe and a scroll is a slow movement. Entirely different things on a proper clickpad.

The above works in most windows (surely in all browsers), including nautilus, discord app, etc.

That's great! Thank you very much

smileBeda commented 7 months ago

@luyanfeng \ @iberianpig - unfortunately it is wonky. The more I used, the less I was happy about it, and had to disable it. There is no treshold! Meaning, you barely touch the clickpad in a horizontal swipe fashion (literally barely, you even wonder how it is horizontal or swipe at all, so minimal it is) and the browser navigates back/forth.

Great, when you test it, you think "wow it is snappy". Awful, infuriating, when you use it in daily usage.

So I would LOVE to see this in fusuma, because fusuma has treshold!!!


I really do not feel clickpad can be made anywhere close to macOS's experience (which if not already apparent, is my actual goal)

  1. Given all commands are under the hood actual key strokes, things are way too "blocky"
  2. The intermittent "hangs" do not contribute to a better experience.

As an example, if you switch workspaces on a mac, you can actually determine how fast a workspace swicthes by the speed of your drag. You can even hold it there, "in the between", and "peek" at contents of one workspace and the other at the same time (half/half). Given on linux we have to translate gesture to keystrokes, the workspace switch is immediate, uncontrollable so to say.

The same translates into any other gesture (apart of maybe the "drag window around" gesture).

This is really unfortunate, and I would wish there where another way to implement a MacOS like gesture on linux. However I cannot find any other solution, and I have no idea how MacOS does it (it must be "copyable", said code, it cannot be some black magic, but... I just do not know how they do it lol)

That said, this fusuma here is at least approaching a likeness and massively improves the absolutely awful interpretation of gestures "behaviour" that gnome or linux in general believes to be best for a clickpad! Thanks for that for sure :)

However, if you think there is any chance to achieve a more smooth experience - I am ready to help, with whatever I can. I am proficient in Python (and PHP, which here is not really useful lol), so if I can help in any way... let me know. I also own a mac and if needed I am ready to dissect their code - but I do not even know where to start about that, macos is a blackbox to me. I also own a company so I am ready to help financially too, to some extent. Really if we could get these clickpads to work on linux, I believe it would be a major kick.

luyanfeng commented 7 months ago

@luyanfeng \ @iberianpig - unfortunately it is wonky. The more I used, the less I was happy about it, and had to disable it. There is no treshold! Meaning, you barely touch the clickpad in a horizontal swipe fashion (literally barely, you even wonder how it is horizontal or swipe at all, so minimal it is) and the browser navigates back/forth.

Great, when you test it, you think "wow it is snappy". Awful, infuriating, when you use it in daily usage.

So I would LOVE to see this in fusuma, because fusuma has treshold!!!

I really do not feel clickpad can be made anywhere close to macOS's experience (which if not already apparent, is my actual goal)

  1. Given all commands are under the hood actual key strokes, things are way too "blocky"
  2. The intermittent "hangs" do not contribute to a better experience.

As an example, if you switch workspaces on a mac, you can actually determine how fast a workspace swicthes by the speed of your drag. You can even hold it there, "in the between", and "peek" at contents of one workspace and the other at the same time (half/half). Given on linux we have to translate gesture to keystrokes, the workspace switch is immediate, uncontrollable so to say.

The same translates into any other gesture (apart of maybe the "drag window around" gesture).

This is really unfortunate, and I would wish there where another way to implement a MacOS like gesture on linux. However I cannot find any other solution, and I have no idea how MacOS does it (it must be "copyable", said code, it cannot be some black magic, but... I just do not know how they do it lol)

That said, this fusuma here is at least approaching a likeness and massively improves the absolutely awful interpretation of gestures "behaviour" that gnome or linux in general believes to be best for a clickpad! Thanks for that for sure :)

However, if you think there is any chance to achieve a more smooth experience - I am ready to help, with whatever I can. I am proficient in Python (and PHP, which here is not really useful lol), so if I can help in any way... let me know. I also own a mac and if needed I am ready to dissect their code - but I do not even know where to start about that, macos is a blackbox to me. I also own a company so I am ready to help financially too, to some extent. Really if we could get these clickpads to work on linux, I believe it would be a major kick.

You are right. I found , In some scenarios that require horizontal sliding, syngeture cannot stop, and it cannot identify when it needs to be executed and when it does not. Finally I also disabled it

smileBeda commented 7 months ago

... which is an absolute shame lol because it is the only tool far and wide that even dares to attempt two finger horizontal gestures. All others are like "nah, impossible on gnome" :rofl:

I do very much hope Fusuma will include this some day.