Linux three finger drag

Содержание
  1. Enable 3 Finger Gesture for click and drag on Windows and Linux
  2. Windows
  3. Linux
  4. GitLab gestures Project information Project information Activity Labels Members Repository Repository Files Commits Branches Tags Contributors Graph Compare Locked Files Issues 9 Issues 9 List Boards Service Desk Milestones Iterations Requirements Merge requests 1 Merge requests 1 CI/CD CI/CD Pipelines Jobs Schedules Test Cases Deployments Deployments Environments Releases Monitor Monitor Incidents Packages & Registries Packages & Registries Container Registry Analytics Analytics CI/CD Code review Insights Issue Repository Value stream Wiki Wiki Snippets Snippets Activity Graph Create a new issue Jobs Commits Issue Boards Collapse sidebar Close sidebar Three finger drag on Linux While the feature is currently not supported by libinput-gestures (which has a somewhat different aim), there are other ways to do that on Linux. Here are some resources you might want to check out: Источник three finger drag у кого получалось настроить three finger drag через libinput ? есть ноут с тачпадом (а также подключенный через блютуз apple trackpad) — на нём убунта 17.04. пока что всё что я попробовал: 1) https://github.com/p2rkw/xf86-input-mtrack — работает, но крешит иксы постоянно (больше пяти минут ещё не проработал). 2) https://github.com/quadpixels/three-finger-dragging — хаканый synaptics. работает, но хотелось бы как-то это сделать стандартными средствами. А что подразумевается под трёхпальцевым перетаскиванием на тачпаде? З.Ы. У меня традиционно висит клик 3-ей кнопкой мыши в позиции указателя на трёхпальцевый тап по тачпаду. Проблем с настройкой минимум — единственное, курсор при трёхпальцевом тапе дёргается. имею в виду аналогичный мак оси экспиренс — когда удерживаешь на таче три пальца — виртуально он зажимает левую кнопку мыши и держит её, что позволяет выделять так текст или перетаскивать окна. в общем продолбался несколько дней, нормального результата не удалось добиться (работает, но кривовато — например курсор может прыгать в сторону сам по себе, само позиционирование гораздо менее точное чем в os x, хотя трекпад использую тот же — magic trackpad). В классических для линукса и винды интерфейсах такой странный жест принципиально отсутствует. Его функционал хорошо исполняется удержанием правой кнопки мыши, а тачпадом эмулируется как бысртый двойной клик одним пальцем с удержанием пальца на тачпаде после второго нажатия. В принципе, через консольный synclient или ещё каким настройщиком, можно настроить какое нибудь извращённое действие на трёхпальцевый тап с удержанием, но думаю драйвер написан так, что курсор будет следовать за средним арифметическим от этих 3 пальцев. Отсюда и рывки курсора. В макоси видимо драйвер изначально заточен под такие жесты. З.Ы. я не знаком с макосью — мак днём с огнём не сыщешь, не сильно то и надо, а хакинтош известен своей проблемностью, но никак не удобством и функционалом. Так что я мог просто не понять, что же такого делает этот трёхпальцевый тап. Источник Linux three finger drag THREE FINGER DRAG
  5. Three finger drag on Linux
  6. three finger drag
  7. Linux three finger drag
  8. 3-finger drag #10
  9. Comments
  10. nos1609 commented Apr 11, 2016
  11. bulletmark commented Apr 11, 2016
  12. nos1609 commented Apr 11, 2016
  13. bulletmark commented Apr 11, 2016
  14. DonnieWest commented Apr 12, 2016
  15. nos1609 commented Apr 12, 2016
  16. bulletmark commented May 4, 2016
  17. grigio commented Sep 19, 2016
  18. bulletmark commented Sep 19, 2016
  19. grigio commented Sep 20, 2016
  20. joshuap commented Oct 15, 2016
  21. grigio commented Oct 15, 2016
  22. etnbrd commented Oct 25, 2016
  23. grigio commented Oct 25, 2016
  24. joshuap commented Oct 25, 2016
  25. etnbrd commented Oct 26, 2016 •
  26. aviwad commented May 18, 2017
  27. kprinssu commented Jul 17, 2017
  28. daveriedstra commented Nov 25, 2018
  29. anbroid commented Dec 2, 2018
  30. b1f6c1c4 commented Mar 3, 2019
  31. codelalala commented Mar 5, 2019
  32. davidvicuna commented Jun 25, 2019 •
  33. daveriedstra commented Jun 27, 2019
  34. amarullz commented Jul 27, 2019 •
  35. nik1154 commented Aug 29, 2019
  36. Hey @amarullz Where do I paste this code? If I paste this in the config, the following error comes up.
  37. do-sch commented Sep 28, 2019
  38. aviwad commented Sep 28, 2019
  39. cpphey commented Dec 16, 2019 •
  40. bulletmark commented Dec 16, 2019
  41. specious commented Jul 31, 2021

Enable 3 Finger Gesture for click and drag on Windows and Linux

May 27, 2020 · 4 min read

Three finger drag is a multi-touch gesture on Mac OS that simulates the click and drag gesture for selecting text, resizing windows and other things. People who spend their time switching between OSs can get very used to this gesture because of its simplicity and ease of use, but it can break your workflow and cause unnecessary stress when you find that the feature is missing on non-Apple devices. This guide details the procedure to getting similar gestures up and running on any other laptop with a touchpad that supports multi-finger gestures.

Note: Fo r some reason, this setting is disabled by default on newer versions of Mac OS, so if you haven’t used this feature on a MacBook before, I highly recommend trying it out. The setting is under the Accessibility menu in System Preferences.

Windows

To enable this on Windows, we will be using a scripting engine called AutoHotKey. This engine basically monitors for keyboard and mouse events, and allows you to write instructions that will be executed when a specific input event is triggered. Now, unfortunately Windows does not fire an event as soon as your fingers touch the pad, but only when you touch the trackpad and raise your fingers, i.e. a three finger tap. (This gesture normally opens Cortana on Windows 10). Since Windows is not open source — Thanks, Microsoft! — the only way to implement true 3 finger drag would be by creating a custom trackpad driver like this one or by using Microsoft’s raw device input APIs . Both of these options require details specific to different latptop models, like the hardware vendor ID or HID Usage ID, so it’s not possible to have a solution that works out of the box on all Windows laptops.

So this is how my solution using AutoHotKey works:

  • Position your mouse wherever you want to click and drag from and do a 3 finger tap on the touchpad
  • Move the mouse using a single finger like you normally do, except now the system acts like you’re click-and-dragging to that location. You can take your finger off the touchpad and on again to cover large portions of the screen, or even use the two finger gesture to scroll through large articles like this one and select the entire text.
  • When you’re done selecting, tap again either with a single finger or with 3 to end the gesture. You can now copy your selected text, or if you’d been moving windows around, it will now stop following your cursor. (I found that a single finger tap to end the gesture to end the drag feels much more natural, however I added the three finger as well for consistency.)
Читайте также:  0x800f081f ошибка 0x800f081f при обновлении windows 10 как исправить

If you’re ready to try it out on your machine, follow the instructions below:

  1. Download and install AutoHotKey from https://www.autohotkey.com
  2. Download my AutoHotKey script from here (The code is available below as well)
  3. Double click the ahk file you downloaded to run it, and then test out your new gesture by following the explanation above to select this article! 🙂
  4. If you like the gesture and want to keep it on permanently, you’ll need to add a shortcut to the .ahk file to your Windows startup folder. Click here for instructions on that.

Source code for the script:

That’s it! This method will work on every Windows Precision touchpad, and even on older ones that support three finger taps (Most Lenovo laptops that use Symantec touchpads).

Linux

Linux users can rejoice, as none of the caveats I mentioned above for Windows are applicable here. You really will get true three-finger drag gesture on Linux, and it should work regardless of whether you use Xorg or Wayland, or Gnome/Xfce/KDE. (Note: Tested on Ubuntu 20.04 with Gnome on both Xorg and Wayland) This does require that your touchpad be using the libinput drivers, which is the default on basically every distro updated in the last few years.

Huge thanks to github user jafd who did the heavy lifting of patching libinput to support the gesture. You can find his original post about the feature along with links to the source code here.

A warning before you begin: This procedure is a little risky, and you may lose control of your mouse and trackpad if this goes wrong. Make sure you can access your machine through some other setup like SSH. If following these instructions fails, you will need to revert to the default libinput installation

  1. Download the patched, precompiled binary for libinput here. It was compiled on a 64 bit Ubuntu machine (AMD64). Please comment with your system details if the binary doesn’t work on your laptop. If you’d prefer, you can also manually compile libinput from the patched code and install it. Code and installation instructions are all available from the link to the original post above.
  2. Open a terminal and cd to wherever you downloaded the file. Run the following two commands:

3. Log out and log back in

Note: If your screen went blank when you typed out these commands, don’t fret. Wait for a few minutes and your DE will restart.

I hope you found this gesture as useful as I did. Feel free to comment below with suggestions or questions.

Источник

GitLab
  • gestures
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards

Collapse sidebar Close sidebar

Three finger drag on Linux

While the feature is currently not supported by libinput-gestures (which has a somewhat different aim), there are other ways to do that on Linux.

Here are some resources you might want to check out:

Источник

three finger drag

у кого получалось настроить three finger drag через libinput ? есть ноут с тачпадом (а также подключенный через блютуз apple trackpad) — на нём убунта 17.04.

пока что всё что я попробовал: 1) https://github.com/p2rkw/xf86-input-mtrack — работает, но крешит иксы постоянно (больше пяти минут ещё не проработал). 2) https://github.com/quadpixels/three-finger-dragging — хаканый synaptics. работает, но хотелось бы как-то это сделать стандартными средствами.

А что подразумевается под трёхпальцевым перетаскиванием на тачпаде?

З.Ы. У меня традиционно висит клик 3-ей кнопкой мыши в позиции указателя на трёхпальцевый тап по тачпаду. Проблем с настройкой минимум — единственное, курсор при трёхпальцевом тапе дёргается.

имею в виду аналогичный мак оси экспиренс — когда удерживаешь на таче три пальца — виртуально он зажимает левую кнопку мыши и держит её, что позволяет выделять так текст или перетаскивать окна.

в общем продолбался несколько дней, нормального результата не удалось добиться (работает, но кривовато — например курсор может прыгать в сторону сам по себе, само позиционирование гораздо менее точное чем в os x, хотя трекпад использую тот же — magic trackpad).

В классических для линукса и винды интерфейсах такой странный жест принципиально отсутствует. Его функционал хорошо исполняется удержанием правой кнопки мыши, а тачпадом эмулируется как бысртый двойной клик одним пальцем с удержанием пальца на тачпаде после второго нажатия.

В принципе, через консольный synclient или ещё каким настройщиком, можно настроить какое нибудь извращённое действие на трёхпальцевый тап с удержанием, но думаю драйвер написан так, что курсор будет следовать за средним арифметическим от этих 3 пальцев. Отсюда и рывки курсора. В макоси видимо драйвер изначально заточен под такие жесты.

З.Ы. я не знаком с макосью — мак днём с огнём не сыщешь, не сильно то и надо, а хакинтош известен своей проблемностью, но никак не удобством и функционалом. Так что я мог просто не понять, что же такого делает этот трёхпальцевый тап.

Источник

Linux three finger drag

THREE FINGER DRAG

OSX users will miss the three-finger-drag feature when switch to Linux. With that feature, you can easily select text or drag something around. On Linux, there are two common options to achieve this:

set the following options in xorg.conf and you get three-finger-drag

The problems of mtrack are:

  • not actively maintained
  • less «smooth» than libinput
  • not the default driver for trackpad of Manjaro or Ubuntu, and have some compatibility issues with GDM on my machine
  1. libinput-gestures

libinput-gestures do not natively support three-finger-drag. You need to use this fork three-finger-drag fork which is mentioned in this libinput-gestures three-finger-drag issue. As the author of libinput-gestures replied, libinput-gestures won’t support three-finger-drag due to «To implement this would be messy, require significant processing overhead, and is discordant with the current design.».

so if you use the three-finger-drag fork of libinput-gestures:

  • you can’t use new features of libinput-gestures because the two repos can not be merged easily
  • extra configuration is needed

So with this tool, you can use three-finger-drag with libinput(the underlying tool libinput-gestures based on). You probably will use it with libinput-gestures side by side to add three-finger-drag support.

Disable 3 finger swipe gesture in libinput-gestures

Modify libinput-gestures config file /etc/libinput-gestures.conf or

/.config/libinput-gestures.conf. Add finger_count 4 to essentially disable 3 finger swipe.

Just like libinput-gestures. Fork

and read the output, which is trackpad «raw events». Filter out events of GESTURE_SWIPE_BEGIN, GESTURE_SWIPE_UPDATE and GESTURE_SWIPE_END. Simulate mouse_down on BEGIN, mouse_relative_move on UPDATE and mouse_up on END with libxdo. These three mouse action simulate a three-finger-drag. Call libxdo is more efficient than fork xdotool like libinput-gestures does. Especially when processing GESTURE_SWIPE_UPDATE events which is more frequent than BEGIN and END.

Источник

3-finger drag #10

Comments

nos1609 commented Apr 11, 2016

Can you add funcitionnality to transform

GESTURE_SWIPE_UPDATE +35.32s 3 0.06/-0.29 ( 0.14/-0.71 unaccelerated)
into something like
gesture: drag 3 xdotool click 1 mousedown —delay 100 1 mousemove_relative x y

into the end of dragging?
something like

gesture: drag 3 xdotool mouseup 1

Gnome has an already working feature to drag anything by tapping the object once and dragging it on second click. So all we need is simulating a click and left button hold while receiving GESTURE_SWIPE_UPDATE. When there is a GESTURE_SWIPE_END event the left mouse button has to be released.

Could you please add this feature.
Thank You!

The text was updated successfully, but these errors were encountered:

bulletmark commented Apr 11, 2016

So you want to move windows using a 3 finger swipe movement?

And btw, is that «gnome» feature you describe actually the libinput feature called tap-and-drag as described here https://wayland.freedesktop.org/libinput/doc/latest/tapping.html

nos1609 commented Apr 11, 2016

Yes, but it’s not limited to windows, it’s a system wide feature.
I think so, but more precisely the Tap-and-drag one.

I’ve been looking for the native feature, but as far as I can see developers decided not to implement rhe feature inside the libinput driver itself, but leaving it on the compositor side.

bulletmark commented Apr 11, 2016

Can you please explain more precisely what you want? What do you mean «a system wide feature»?

DonnieWest commented Apr 12, 2016

While I can’t speak on @nos1609 behalf, I know that I would love a three finger drag akin to the way Mac OS X does it: moving windows, selecting text, etc.

Essentially tap-and-drag implemented as a three finger swipe gesture

nos1609 commented Apr 12, 2016

@bulletmark I mean that using Gnome DE there is ther possilbility of dragging anything, not only windows like @DonnieWest precised. So we can assume it as a system-wide feature.

bulletmark commented May 4, 2016

I prefer not to implement this sorry. This utility is a simple design and imposes little system performance overhead. I’d like to keep it that way. At present, it merely actions a single command (typically via xdotool) at the very end of the sequence of frequent gesture updates. The proposal here would require it to action a command at every gesture update which is alien to it’s current design. I’m not confident that it would perform very well either.

grigio commented Sep 19, 2016

Any update about how to do «3 finger drag» on Linux?

bulletmark commented Sep 19, 2016

No, my comment just above yours still applies. To implement this would be messy, require significant processing overhead, and is discordant with the current design.

grigio commented Sep 20, 2016

I know I was just asking if now there is a way to do it because it is very convenient in several situations, ex. moving inside google maps

joshuap commented Oct 15, 2016

I’d also love to know if anyone finds a way to implement this; I really miss the three-finger drag feature from macOS.

grigio commented Oct 15, 2016

I think the correct place to follow this issue is https://bugzilla.gnome.org/show_bug.cgi?id=768421

etnbrd commented Oct 25, 2016

I used xf86-input-mtrack, and it allows 3-fingers drag with proper configuration.

grigio commented Oct 25, 2016

@etnbrd Thanks, I’ll try it which is the output of your xinput ? I hope it will also work with Synaptics touchpads

joshuap commented Oct 25, 2016

@etnbrd could you share your config?

etnbrd commented Oct 26, 2016 •

You will find all the documentation here : https://github.com/BlueDragonX/xf86-input-mtrack
The 3-finger drag is configured by all the Swipe* stuffs, I think.

But I have to say, I just reinstalled my machine, and noticed that I don’t need xf86-input-mtrack anymore for multi-touch to work, except for the 3-finger drag. So here I was on this thread, reading your posts.
I think I will give xinput a go, and wait for the 3-finger drag to sort itself out.

aviwad commented May 18, 2017

xf86-input-mtrack won’t work on Wayland though 🙁
any alternatives??

kprinssu commented Jul 17, 2017

daveriedstra commented Nov 25, 2018

For those interested: I’ve just forked this repo and added swipe begin/update/end gestures which can be used for a crude 3-finger drag as @nos1609 suggested. It’s «crude» because it seems to bypass pointer acceleration, but it’s enough to still be functional (at least on my machine).

I added this usage example to the config:

Thanks @nos1609 for the idea and @bulletmark for the very elegant code which made it straightforward to implement. I understand you’re not looking to add this feature to the main design, but I’d be happy for your (or anyone’s) comments on the code as I’m not very pythonic.

anbroid commented Dec 2, 2018

Hi, tried the 3-finger-drag branch and the feature works great! I was even able to make it drag windows with the pointer anywhere on the window (not just the title bar) making it very much easier to drag windows at will! Taking advantage of the «move window» keyboard shortcut I’m using in my XFCE window manager settings:
gesture swipebegin all 3 xdotool key alt+F7
gesture swipeend all 3 xdotool key alt+F7
gesture swipeupdate all 3 xdotool mousemove_relative — x y

b1f6c1c4 commented Mar 3, 2019

Hi, tried the 3-finger-drag branch and the feature works great! I was even able to make it drag windows with the pointer anywhere on the window (not just the title bar) making it very much easier to drag windows at will! Taking advantage of the «move window» keyboard shortcut I’m using in my XFCE window manager settings:
gesture swipebegin all 3 xdotool key alt+F7
gesture swipeend all 3 xdotool key alt+F7
gesture swipeupdate all 3 xdotool mousemove_relative — x y

A better, and universal (works in all DE/WM) way to do this is to use xdotool :

codelalala commented Mar 5, 2019

Hi, tried the 3-finger-drag branch and the feature works great! I was even able to make it drag windows with the pointer anywhere on the window (not just the title bar) making it very much easier to drag windows at will! Taking advantage of the «move window» keyboard shortcut I’m using in my XFCE window manager settings:
gesture swipebegin all 3 xdotool key alt+F7
gesture swipeend all 3 xdotool key alt+F7
gesture swipeupdate all 3 xdotool mousemove_relative — x y

A better, and universal (works in all DE/WM) way to do this is to use xdotool :

Indeed this is a better way. It can move window regardless of where the mouse pointer is.

davidvicuna commented Jun 25, 2019 •

Hi am new to Linux and i dearly miss the 3 finger drag. Could anyone give me a heads up on what to do/install to configure it? i am on manjaro.

daveriedstra commented Jun 27, 2019

@davidvicuna You’ll need to install the version from this repo (the instructions are the same) and use something like the example three finger drag config. Be sure to read the three-finger drag paragraph in the readme.

amarullz commented Jul 27, 2019 •

I forked @daveriedstra repo, then Add timeout for swipe gesture and add delays for drag gesture, so I can use drag and swipe in the same time (4 finger swipe and 4 finger drag or 3 fingers).

I know it was a hack, but It works fine for now and can be use for productivity.

Here the extra config:

EDIT: set gesture_all3_use_delay 0 if you dont use three finger swipe (only used it for 3 finger drag/drop)

nik1154 commented Aug 29, 2019

I forked @daveriedstra repo, then Add timeout for swipe gesture and add delays for drag gesture, so I can use drag and swipe in the same time (4 finger swipe and 4 finger drag or 3 fingers).

I know it was a hack, but It works fine for now and can be use for productivity.

Here the extra config:

EDIT: set gesture_all3_use_delay 0 if you dont use three finger swipe (only used it for 3 finger drag/drop)

Hey @amarullz
Where do I paste this code?
If I paste this in the config, the following error comes up.

Error at line 5 in file

do-sch commented Sep 28, 2019

I wrote a GNOME Shell Extension to adapt window dragging with three fingers.
The downside is that it is only working on Wayland.

aviwad commented Sep 28, 2019

@do-sch this is INCREDIBLE! Thank you so much!

cpphey commented Dec 16, 2019 •

@daveriedstra I having trouble copying text selected with a 3 finger scroll.

  • I am using gnome with xorg
  • I am using 2 finger scrolling from the gnome settings also
  • without libgestures, I could tap with two fingers and see the menu in chrome which let me copy text show up
  • I can select text in chrome with 3 fingers. This is from your repo

However the issue is after selecting the text it, the browser somehow goes back to the previous page.

gesture swipebegin all 3 xdotool mousedown 1
gesture swipeend all 3 xdotool mouseup 1
gesture swipeupdate all 3 xdotool mousemove_relative — x y

bulletmark commented Dec 16, 2019

@cpphey, please discuss issues about @daveriedstra code on his repo, not here.

specious commented Jul 31, 2021

What people call three-finger drag is actually just a three finger swipe simulating a mouse movement with the left button pressed.

I’m currently using @jasper-van-bourgognie’s fork of libinput (installed via the libinput-three-finger-drag user package in arch linux) which is working as intended with either sway or xorg (using xf86-input-libinput).

It looks like @jasper-van-bourgognie has been applying @complyue’s changes to newer versions of libinput in an effort to keep it up-to-date.

I think the pertinent question is which layer should this functionality ultimately be implemented in. It seems like either it should be in libinput itself or in the application layer (wayland compositor or xorg window manager).

It looks like the set of changes to libinput is rather minimal. In my experience, it’s working really well and the window manager doesn’t even need to know how you’re doing it. I’m using it constantly to select text by moving three fingers over the touchpad surface (and occasionally I drag a window, although that is almost never necessary with sway).

As it looks like there’s a discussion currently ongoing about including three-finger drag in libinput, perhaps we should shift our attention there.

Источник

Оцените статью