Skip to content
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

Gesture bindings #372

Open
YaLTeR opened this issue May 21, 2024 · 7 comments
Open

Gesture bindings #372

YaLTeR opened this issue May 21, 2024 · 7 comments
Labels
enhancement New feature or request needs design Need to figure out how exactly to implement this

Comments

@YaLTeR
Copy link
Owner

YaLTeR commented May 21, 2024

Add some way to customize gesture bindings. I don't have a concrete design yet, but:

  1. Users should be able to customize how many fingers to use for the swipe gestures (supersede Add support for using a different amount of fingers for swiping. #315, cc @MagneFire)
  2. I should be able to add new gestures without breaking users' configs
  3. Users should be able to bind gestures only where it makes sense, i.e. swipe actions to swipe gestures and not to pinch gestures for example

I'm thinking something like a binds section, but for gestures. To satisfy 1. and 2., maybe encode number of fingers explicitly into the "key"?

gestures {
    touchpad-swipe-3-horizontal horizontal-view-movement
    touchpad-swipe-3-vertical workspace-switch
    Mod+Mouse3-horizontal horizontal-view-movement
    Mod+touch-swipe-3-horizontal horizontal-view-movement
}

This way, I can add new defaults when this section is missing from the config, and when it is present in the config the user will just need to add new gestures manually.

I don't entirely like this though, looks kinda awkward.

Also, I can see a problem in the future where there may be a 2D gesture, and so you will need to be able to bind either touchpad-swipe-N to a 2D gesture, or separate touchpad-swipe-N-horizontal/vertical to 1D gestures. But also maybe that's not a problem and can just be verified during parsing.

Also, this "gestures" section that I have in mind seems to be mainly about continuous gestures (swipe and pinch) and not about discrete gestures like double-resize-click (these seem more fit for the regular binds section).

Also, should it be allowed to bind "vertical" to "horizontal" gestures and vice versa? Maybe not.

@YaLTeR YaLTeR added enhancement New feature or request question Further information is requested needs design Need to figure out how exactly to implement this and removed question Further information is requested labels May 21, 2024
@YaLTeR
Copy link
Owner Author

YaLTeR commented Jul 1, 2024

How about this:

gestures {
    touchpad-swipe-3 horizontal="view-movement" vertical="workspace-switch"
    Mod+Mouse3 horizontal="view-movement" vertical="workspace-switch"
    Mod+Mouse2 "resize-window"
}

You can only set either an argument, or the properties. All three have only those variants that make sense for that property (i.e. no vertical-only gestures in the horizontal property).

I'm still not sure about encoding the finger count into the "key" name.

in the future where there may be a 2D gesture

Examples: currently existing interactive window resize; future interactive window move. For the resize it even makes sense to be able to bind just the horizontal part (since we're a scrolling WM).

@markomarkovic
Copy link

I was looking for a way to set Mod+Mouse1 for horizontal view movement, this would solve that issue nicely.

The encoding of the finger count into the key name makes sense to me.

@IvanTurgenev
Copy link

Yeah even mouses nowadays have gesture buttons image

@nakibrayan3
Copy link

how about some thing like this:

gestures {
  touchpad-swipe-3-horizontal-left focus-column-left
  touchpad-swipe-3-horizontal-left focus-column-right
}

So that the touchpad gestures are identical to the keyboard shortcuts for focusing columns. this fixes #466

@YaLTeR
Copy link
Owner Author

YaLTeR commented Sep 8, 2024

I envision the gesture bindings section only for continuous binds, and the regular bind section for discrete binds.

@valpackett
Copy link

Do you have any thoughts on forwarding continuous gestures to layer-shell based desktop components? (think being able to pinch in the app menu from anywhere like on macOS) I have previously prototyped that for Wayfire in wf-globalgestures which exposes a custom protocol, but I think I'd be fine with a config-based solution to avoid having Yet Another Protocol, like so (this example would result in that gesture always being forwarded to a client with matching 'namespace' on the current output):

gestures {
    touchpad-pinch-4 forward-to-client namespace=r#"^owo\.uwu\.ControlCenter$"#
}

@YaLTeR
Copy link
Owner Author

YaLTeR commented Sep 28, 2024

Hm, interesting idea. Need to look into it when implementing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs design Need to figure out how exactly to implement this
Projects
None yet
Development

No branches or pull requests

5 participants