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

{kwin,libinputactions}: refactor architecture, implement mouse gestures #81

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

taj-ny
Copy link
Owner

@taj-ny taj-ny commented Mar 2, 2025

One million changes in a single PR, as per usual.

Features

  • Stroke gesture, supports touchpads as well
  • Mouse gestures (Plasma 6.3 required): press, wheel, stroke, swipe
  • Gesture begin/end positions - currently only works with mouse gestures
  • Touchpad scroll timeout (controls when 2-finger swipes end) can now be configured
  • One action group - only executes a single action from the group, replaces Action.block_other

Changes

  • Project renamed to Input Actions, will eventually support other environments than just Plasma

Fixed bugs

  • Update actions intervals belonging to single-directional gestures of certain directions only work if negative.

Gesture conflicts

All other gestures are now cancelled when:

  • a gesture is updated, and has any action that has been executed, or has an update action that can be executed (satisfies conditions and thresholds) but hasn't been yet (the interval hadn't been reached)
  • a gesture ends, and it has an end action that can be executed

This makes it no longer necessary to resolve gesture conflicts manually. For example, if you had two of the same gestures , but one required Meta to be pressed and the other didn't, you had to set keyboard_modifiers: none on the latter one, otherwise it would always trigger.

Fixed bugs

  • Non-zero interval actions of bi-directional gestures ignore the delta of the event where the direction changes. Due to the high polling rate, this wasn't noticeable at all.

Configuration

New properties

Root.mouse, Mouse.motion_timeout, Mouse.press_timeout, Touchpad.scroll_timeout, Gesture.start_positions, Gesture.end_positions, Gesture.mouse_buttons, PressGesture.instant

Changed properties

  • Gesture.fingers - Default value changed to 1
  • Gesture.type - New values (wheel, stroke), hold renamed to press but can still be used

Removed properties

  • Action.block_other - Use the one action group instead

To do

  • Swipe gesture
  • Press gesture
  • Wheel gesture
  • Stroke gesture
  • Automatic gesture conflict resolution
  • Replace edges with start position percentages (min_x,min_y - max_x,max_y) - way more flexible
  • Small threshold for motion gesture activation, it's really easy to accidentally activate those instead of press gestures
  • Allow timeouts to be configured
  • Add support for Make it build on Plasma 6.1 and 6.2
  • Clean up the mess

@taj-ny taj-ny added this to the v0.6.0 milestone Mar 2, 2025
@taj-ny taj-ny linked an issue Mar 2, 2025 that may be closed by this pull request
4 tasks
@taj-ny
Copy link
Owner Author

taj-ny commented Mar 15, 2025

I updated the documentation (see first comment for added/changes properties) and example gestures. It only builds on Plasma 6.3 right now but some feedback would be nice.

Gesture.gesture_timeout and Gesture.button_timeout currently cannot be changed.

@taj-ny taj-ny linked an issue Mar 28, 2025 that may be closed by this pull request
@taj-ny taj-ny changed the title {kwin,libgestures}: implement mouse gestures {kwin,libinputactions}: refactor architecture, implement mouse gestures Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When a gesture begins, all other gestures should be cancelled Mouse gestures Stroke gesture
1 participant