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

3-finger drag #10

Closed
nos1609 opened this issue Apr 11, 2016 · 37 comments
Closed

3-finger drag #10

nos1609 opened this issue Apr 11, 2016 · 37 comments

Comments

@nos1609
Copy link

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

and

GESTURE_SWIPE_END +35.34s 3

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!

@bulletmark
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@DonnieWest
Copy link

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
Copy link
Author

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
Copy link
Owner

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
Copy link

grigio commented Sep 19, 2016

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

@bulletmark
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link

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
Copy link

etnbrd commented Oct 25, 2016

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

@grigio
Copy link

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
Copy link

joshuap commented Oct 25, 2016

@etnbrd could you share your config?

@etnbrd
Copy link

etnbrd commented Oct 26, 2016

/usr/share/X11/xorg.conf.d/10-mtrack.conf

Section "InputClass"  
  Identifier "touchpad"
  Driver "mtrack"
  MatchIsTouchpad "on"
  Option "Sensitivity" "0.65"
  Option "IgnorePalm" "true"
  Option "ClickFinger1" "0"
  Option "TapButton1" "1"
  Option "TapButton2" "3"
  Option "TapButton3" "2"
  Option "ScrollUpButton" "5"
  Option "ScrollDownButton" "4"
  Option "ScrollLeftButton" "7"
  Option "ScrollRightButton" "6"
  Option "SwipeDistance" "1"
  Option "SwipeLeftButton" "1"
  Option "SwipeRightButton" "1"
  Option "SwipeUpButton" "1"
  Option "SwipeDownButton" "1"
  Option "SwipeClickTime" "0"
  Option "SwipeSensitivity" "1000"
EndSection

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
Copy link

aviwad commented May 18, 2017

xf86-input-mtrack won't work on Wayland though :(
any alternatives??

@kprinssu
Copy link

@GNOME-IS-LIFE there is an updated fork here, https://github.com/p2rkw/xf86-input-mtrack

@daveriedstra
Copy link

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:

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

https://github.com/daveriedstra/libinput-gestures/tree/three-finger-drag

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
Copy link

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
Copy link

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:

gesture swipeupdate all 3 xdotool getactivewindow windowmove --relative -- x y

@codelalala
Copy link

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:

gesture swipeupdate all 3 xdotool getactivewindow windowmove --relative -- x y

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

@davidvicuna
Copy link

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
Copy link

@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
Copy link

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).

https://github.com/amarullz/libinput-gestures

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

Here the extra config:

###############################################################################
# You can set a maximum timeout to limit swipe gestures from actioned using 
# the swipe_timeout configuration command.
# Specify this value in dots. The default is 200, disable timeout, set it to 0
swipe_timeout 150

###############################################################################
# If you want to use "gesture * all" or drag with 3/4 fingers while still
# use gesture, it will be better to set delay before the action triggered,
# so the swipe gesture wont have any glitch. You can set the delay (ms) using
# the gesture_all_delay command (*)in millisecond unit, and enable/disable
# delays with gesture_all3_use_delay or gesture_all4_use_delay set to
# 0 for disable, 1 for enable.

# in millisecond
gesture_all_delay 150

# 3 fingers
gesture_all3_use_delay 1

# 4 fingers
gesture_all4_use_delay 1

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

@nik1154
Copy link

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).

https://github.com/amarullz/libinput-gestures

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

Here the extra config:

###############################################################################
# You can set a maximum timeout to limit swipe gestures from actioned using 
# the swipe_timeout configuration command.
# Specify this value in dots. The default is 200, disable timeout, set it to 0
swipe_timeout 150

###############################################################################
# If you want to use "gesture * all" or drag with 3/4 fingers while still
# use gesture, it will be better to set delay before the action triggered,
# so the swipe gesture wont have any glitch. You can set the delay (ms) using
# the gesture_all_delay command (*)in millisecond unit, and enable/disable
# delays with gesture_all3_use_delay or gesture_all4_use_delay set to
# 0 for disable, 1 for enable.

# in millisecond
gesture_all_delay 150

# 3 fingers
gesture_all3_use_delay 1

# 4 fingers
gesture_all4_use_delay 1

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 ~/.config/libinput-gestures.conf:

gesture_all3_use_delay 0 <<
Configuration command "gesture_all3_use_delay" is not supported.
Must be "gesture" or "device" or "swipe_threshold".
====================================================

@do-sch
Copy link

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.

https://extensions.gnome.org/extension/2164/three-finger-window-move/

@aviwad
Copy link

aviwad commented Sep 28, 2019

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

@cpphey
Copy link

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
Copy link
Owner

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

@specious
Copy link

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.

@paulolieuthier
Copy link

@specious does it work for you to change a window's size in Sway's floating mode?

@specious
Copy link

I'm able to drag the individual sides of a floating window. I can also drag the entire window by grabbing any part of it if I hold down the designated mod key. That's because in my sway config I have:

# Use mouse+$mod to drag floating windows
floating_modifier $mod

It is interesting, however, that I can't drag two sides simultaneously by dragging a corner.

@2ndBillGates
Copy link

would love to use it on KDE Plasma with Wayland

@luigi370
Copy link

luigi370 commented Apr 6, 2023

So, with yesterday's update, libinput-three-finger-drag is not working anymore. Any way to get this feature working? thanks

@bulletmark
Copy link
Owner

@luigi370 "yesterday's update" of what?

@luigi370
Copy link

xf86-input-libinput 1.2.1-1 -> 1.3.0-1 (Arch linux) after updating with pacman this, the system was able to boot but i was not able to pass the login screen as my keyboard and mouse where dead. Only way to fix it was installing libinput and of course.. uninstall libinput-three-finger-drag.

@DonnieWest
Copy link

DonnieWest commented Apr 14, 2023

This is the wrong project. libinput-three-finger-drag comes from https://github.com/jasper-van-bourgognie/libinput according to the PKGBUILD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests