[Available until the end of 2024] Mouse gestures support on Plasma 6 Wayland

+50€ by Paypal when initial requirements are met.
+100€ by Paypal for extra feature that Easystroke have. It can detect starting point of mouse gesture and underlying window. So if gesture has started above e.g. Firefox then only secondary button could invoke gesture.

That way e.g. RMB will invoke gesture; but if the underlying window is Firefox(blacklisted application), RMB will be captured by FF’s Gesurefy addon. In that case, kwin mouse gesture could only be captured by secondary button.

Sorry for late response.

7 Likes

I’m not completely sure how exactly this rponsored work works, but I’m also willing to donate 25-50 dollars for this long forgotten, but loved feature (especially when easystroke is not working for me anymore)

6 Likes

I’ve decided that for the remaining month or so until Plasma 6.1 feature freeze, I’ll focus on getting the monitor brightness work over the finish line that I had started earlier. For 6.2, the plan is to then focus on getting mouse gestures upstreamed and hooked up with configurable actions. In addition to the links from the last post, note this discussion with KWin developers about outstanding questions and the way forward.

10 Likes

Hey folks, brief update and sorry for the long wait.

Full transparency: my monitor brightness work took way longer than I had anticipated and there are still a handful of bugs that I or the KWin people need to fix more or less urgently. But that feature is in, I anticipate I won’t spend much more than a week or two on this batch of improvements.

But also, we haven’t been entirely idle. Natalie Clarius and I submitted a grant proposal to NLnet which would provide funding for several months to work on touch gestures as well as stroke gestures (a.k.a. mouse gestures). If this gets accepted, I can make it my main focus. If not, I’ll still work on it but will have to do it in addition to other stuff that pays the bills. Whatever NLnet decides in the end, at least we came up with a somewhat detailed plan for what needs to be done to make this happen.

Furthermore, @Duha approached me with an idea to make input handling one of KDE’s priority goals for the next two years, we spent some time putting this together, and the community thought it was one of the three most important topics to work on. Which mainly means that we as goal champions now have to do more communication and recruitment to get everyone else fired up and chiming in, but hey. Mouse gestures are specifically mentioned in the original proposal, this work is now officially a priority task for KDE.

I figure that at this point, I’ll miss @fusionfuture’s 2024 deadline. I know you guys have been waiting patiently for this and I apologize for signing up for this before I was really able to make the time. If anyone still wants to grab this before NLnet gets back to us in about two months or so (I think?), by all means go for it. Happy to forfeit the bounty if someone else can get it done faster.

12 Likes

This sounds like great news as it was a show stopper for me.
(With that added, hopefully, only an application-independent on-screen keyboard [like Onboard on 5] missing.)

3 Likes

IMO you’ve proposed a solid plan for the task which importance has been recognized as an elected KDE goal. Therefore, I would like to revoke my restriction regarding deadline :slight_smile: Best of luck with that grant proposal and godspeed.

5 Likes

God love you lot, I woke up so damned sore this morning, super depressing, then checked my email and this thread put a smile on my face and hope in my heart.

I don’t know how payment works for this but I’ve got 50 aussie dollarydoos with your name on it. I know that ain’t a lot but nor is the disability pension here :smiley: If you need any of my time, you’ve got it.

5 Likes

No apology necessary - I am very satisfied with your response and look forwards to seeing this progress. Moving from ‘easystroke’ to using KDE’s native gestures was incredible, and I pray it can come home to roost on Wayland.

5 Likes

There are now about 1500 Dollar in the pot, if I count correctly. I am willing to give another 100 Dollar.

I’m still using Easystroke, but see its end coming with Wayland. So the new software should also have Easystroke’s functionality. So especially (and in contrast to the quite primitive old KDE-Gestures): Timeout-Gestures, Multiple-Button-Support, Scroll-Gestures, App-Specific-Gestures.

But one thing I do not quite understand: What is the advantage of doing all this coding-work only for KDE alone and not as a standalone app for all desktop-environments? Why do we want this only for us and not for the others?

Why not give the 1600 Dollars to mouse-actions for example? … or a fork of it. … to iron out their bugs?

Just to mention: As someone above already asked … I also absolutely do not understand why not everybody is using mouse-gestures!? … It makes life soo much easier. … lol … Why are they missing out on this precious jewel of usefulness?

4 Likes

A small bump from me as well! I was digging a bit today to see how the stroke recognition could actually be implemented, since @jpetso has already got a working proof of concept on github. From what I can understand, it looks like there are multiple new commits on xdg-desktop-portal-kde that should allow input capture even at a global level, or am I misunderstanding?

1 Like

Some of us are waiting with baited breath here - I find it painful using Wayland when Easystroke works so well with X11.

2 Likes

I’m currently working on adding mouse gestures to my plugin for customizing touchpad gestures. It’s close to being finished but I can’t say exactly when it’ll be done. You can try it right now by building the mouse-gestures branch. I don’t have the time to attempt upstreaming this, so it will remain a third-party plugin.

The features include (but are not limited to):

  • Wheel gestures
  • Press gestures
  • Stroke gestures (uses code from jpetso’s prototype)
  • Per-application gestures
  • Per-gesture activation buttons and modifiers
  • Start/end positions (not limited to just corners and edges)
  • Activation buttons can still be used but are blocked when necessary
11 Likes

Could you tell me, please, this item should appear in system settings?

3 Likes

Input Actions hasnt appeared in Tools after installation.(Fedora 42). During installation process there were some warnings

InputActions/src/libgestures/libgestures/input.h: In member function ‘virtual void libgestures::Input::keyboardKey(const uint32_t&, const bool&)’:

InputActions/src/libgestures/libgestures/input.h:22:46: warning: unused parameter ‘key’ [-Wunused-parameter]
22 | virtual void keyboardKey(const uint32_t &key, const bool &state) { };
| ~~~~~~~~~~~~~~^
/home/vl/InputActions/src/libgestures/libgestures/input.h:22:63: warning: unused parameter ‘state’ [-Wunused-parameter]
22 | virtual void keyboardKey(const uint32_t &key, const bool &state) { };
| ~~~~~~~~^
InputActions/src/libgestures/libgestures/input.h: In member function ‘virtual void libgestures::Input::mouseButton(const uint32_t&, const bool&)’:
InputActions/src/libgestures/libgestures/input.h:33:46: warning: unused parameter ‘button’ [-Wunused-parameter]
33 | virtual void mouseButton(const uint32_t &button, const bool &state) { };
| ~~~~~~~~~~~~^~
InputActions/src/libgestures/libgestures/input.h:33:66: warning: unused parameter ‘state’ [-Wunused-parameter]
33 | virtual void mouseButton(const uint32_t &button, const bool &state) { };
| ~~~~~~~~^
InputActions/src/libgestures/libgestures/input.h: In member function ‘virtual void libgestures::Input::mouseMoveAbsolute(const QPointF&)’:
/home/vl/InputActions/src/libgestures/libgestures/input.h:34:51: warning: unused parameter ‘pos’ [-Wunused-parameter]
34 | virtual void mouseMoveAbsolute(const QPointF &pos) { };
| ~~~~~~~~~~~~~^
InputActions/src/libgestures/libgestures/input.h: In member function ‘virtual void libgestures::Input::mouseMoveRelative(const QPointF&)’:
InputActions/src/libgestures/libgestures/input.h:35:51: warning: unused parameter ‘pos’ [-Wunused-parameter]
35 | virtual void mouseMoveRelative(const QPointF &pos) { };
| ~~~~~~~~~~~~~^

where can be a problem?

I am waiting forward to release the plugin. Thanks

1 Like

Yes, you should see something like the screenshot above. Some warnings are OK during the build, so long as they are warnings, not errors.

The plugin is very simple and only installs these two files:

/usr/lib64/qt6/plugins/kwin/effects/configs/inputactions_kwin_kcm.so
/usr/lib64/qt6/plugins/kwin/effects/plugins/kwin_gestures.so

Perhaps you might start by checking that they are both in place (this should have happened during make install and will have generated an error if it did not.)

If you start a new thread to avoid hijacking this one, we can work on troubleshooting this problem for you. Perhaps you would prefer to troubleshoot on github, you are welcome to @ me there (same name as here and I have posts in the existing issue/MR) and I will assist if I can.

2 Likes

Hi all. First up, it’s very cool that @taj_ny was able to provide a KWin plugin with many of the features that people have been waiting for.

Secondly, NLnet has decided to approve the grant I mentioned earlier in the thread. In March I thought it wouldn’t happen, because Bhushan’s Plasma Mobile power management improvements grant got approved while we did not receive a notification. But it turns out they just put us into a different fund that got announced a month later.

So, the immediate question I had is, following @taj_ny’s work, will the approved NLnet project be partly obsolete or different in scope than originally proposed? But looking at it, I think the scope is still very much the same, because our project will focus on:

  • Upstreaming all of our gesture code into KWin proper.
  • Designing and implementing GUI settings, as opposed to InputActions’ primarily text-based configuration.
  • Exploring a possible cross-desktop protocol that lets applications declare their “local” actions in addition to Global Shortcuts, so that desktops can show them in a list and optionally assign gestures.

My current understanding is that these goals are largely distinct from what InputActions is trying to achieve, so we plan to go ahead as previously proposed.

I think I’ll get started by upstreaming the stroke recognizer into KWin, and then go from there. If there’s any particular piece of code in InputActions that would be a good candidate for adding to KWin, @taj_ny perhaps you have some thoughts on what work I should avoid duplicating.

13 Likes

This is heartening news indeed!

:vulcan_salute:

1 Like

It depends on how far you want to go with customizability. I looked at the grant application and I’d say the most useful code at the moment is in MouseTriggerHandler, which handles press, motion and wheel gestures, though it still needs some work and as of right now it has 0 tests so not exactly a good candidate.

6 Likes

Secondly, NLnet has decided to approve the grant I mentioned earlier in the thread. In March I thought it wouldn’t happen, because Bhushan’s Plasma Mobile power management improvements grant got approved while we did not receive a notification. But it turns out they just put us into a different fund that got announced a month later.

Hello! I saw your blog post on the KDE community and came back to post again. Congratulations on getting your grant approved! that’s great news.

I’ve got a small suggestion as well, after reading your post/grant applications. If you go down the route of implementing stroke recognition directly into KGlobalAccel, with the current state of things it will have some heavy limitations compared to the old implementation. On the old one, shortcuts were inherently global, while the current shortcuts approach is more application focused. Sure, there are some default global ones, but they cannot be tied to a different keyboard combination.

I’ll go a bit off topic here to make an example:
In my case, I use gestures/keyboard shortcuts heavily to speed up common things, as an example let’s use opening a new tab in a browser.
On both Chromium and Firefox based browsers the default is CTRL+T, and right now there’s no way to create an alternate shortcut that will do the same thing (Such as binding CTRL+T to, for example, ALT+space). With the X11 implementation, it was trivial to create a mouse gesture, bind it to a key combination and then decide on what applications it would work. I had some working even on Dolphin.
Right now on KGlobalAccel you can add an application that’s not listed and it will allow users to add some shortcuts, but adding Chromium or Firefox won’t have an option to bind a shortcut to create a new tab, so in this example even adding mouse gestures wouldn’t really fix the issue.
I hope that whatever approach you go for in the end will allow for true global-wide shortcuts. And thanks in advance for your work!

4 Likes

We’ll start with mouse gestures triggering system-wide keyboard shortcuts as the first feature. It’s the easiest one to implement, and gets a long way to doing what many people want. KWin’s Xaver Hugl is also on board with this plan.

App-specific shortcuts approach are going to expand on this basic functionality, but they’re not meant to replace it. Ideally I’d want Chromium and Firefox to advertise their “New Tab” action with (default or hardcoded) “Ctrl+T” keyboard shortcut to the desktop, even if it’s not a global shortcut. Then the user could configure a gesture specifically for “New Tab” in System Settings, without adding a global “Ctrl+T” binding as workaround.

But that’s just the overall idea, there are a number of details to figure out until we get there, so we’ll tackle this once we get there :slight_smile:

4 Likes