Author Topic: Touchscreen as touchpad - relative mouse input  (Read 17992 times)

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Touchscreen as touchpad - relative mouse input
« on: June 16, 2018, 03:28:30 pm »
A video is worth 1000 words:

https://www.youtube.com/watch?v=bsJn3eMvG7w

tl;dw this technique changes the touchscreen from an absolute mode touchscreen (which is too fiddly for full linux desktop use) into a relative mode touchpad like on most laptops


Easy mode:
  • sudo apt install xserver-xorg-input-mtrack
  • Edit /usr/share/X11/xorg.conf.d/40-libinput.conf, find:
    Code: [Select]
    Section "InputClass"
            Identifier "libinput touchscreen catchall"
            MatchIsTouchscreen "on"
            MatchDevicePath "/dev/input/event*"
            Driver "libinput"
    EndSection
    Replace with:
    Code: [Select]
    Section "InputClass"
            Identifier "libinput touchscreen catchall"
            MatchIsTouchscreen "on"
            MatchDevicePath "/dev/input/event*"
            Driver "mtrack"
            Option "ScrollDistance" "40"
            Option "FingerLow" "1"
            Option "FingerHigh" "2"
            Option "Sensitivity" "1.8"
            Option "BottomEdge" "0"
            Option "SwipeDistance" "100"
            Option "ScaleDistance" "40"
            Option "ButtonMoveEmulate" "false"
            Option "ClickTime" "25"
            Option "MaxTapMove" "55"
            Option "EdgeBottomSize" "0"
    EndSection
  • sudo systemctl restart sddm or reboot
  • Recommended to disable acceleration in the LXQT mouse settings GUI
Hard mode:

(Instead of installing mtrack from debian repos, there is an improved version that must be built from source...)
  • Config edit as above
  • Enter a suitable empty directory
  • Install the standard debian build tools
  • sudo apt install xserver-xorg-dev libmtdev-dev xutils-dev
  • git clone https://github.com/p2rkw/xf86-input-mtrack
  • cd into the downloaded folder
  • ./configure --prefix=/usr
  • dpkg-buildpackage -uc -us
  • cd ..
  • sudo dpkg -i xserver-xorg-input-mtrack_0.5.0_arm64.deb
  • sudo systemctl restart sddm or reboot
  • Recommended to disable acceleration in the LXQT mouse settings GUI
« Last Edit: June 16, 2018, 03:36:49 pm by Kiriririn »

shinkamui

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #1 on: June 17, 2018, 12:32:33 am »
Thank you for this!  Its an excellent start.  Still needs some tweaking, but you've more than got the ball rolling on a very popular request!

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #2 on: June 17, 2018, 07:07:01 am »
Quote from: shinkamui
Thank you for this!  Its an excellent start.  Still needs some tweaking, but you've more than got the ball rolling on a very popular request!

Yeah still need to figure out a way to do dragging that doesn't emit a click before doing so, though I reckon this will either require two fingers or add click latency

Edit: it's possible but fiddly by holding with one finger and moving a second
« Last Edit: June 17, 2018, 07:38:50 am by Kiriririn »

mithrandir

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://www.mygnu.de
Touchscreen as touchpad - relative mouse input
« Reply #3 on: June 17, 2018, 09:14:57 am »
Thx. Very nice work!
Now we have to get this switchable via hotkey... Which seems not no be that easy because of the currently required restart.

Are the different mouse clicks (right,left,middle) already handled somehow? What about scrolling?

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #4 on: June 17, 2018, 10:34:33 am »
Quote from: mithrandir
Thx. Very nice work!
Now we have to get this switchable via hotkey... Which seems not no be that easy because of the currently required restart.

Are the different mouse clicks (right,left,middle) already handled somehow? What about scrolling?

Not sure how you'd go about switching it, personally I don't see a need for any other mode than this but your needs may be different

Right click is two finger tap, scrolling is two finger scroll, left click is just tap, left click drag is hold then move a second finger, not sure about middle mouse but it should be configurable as 3 finger tap or similar

Scrolling a bit shit and left click drag doesn't work unless you install the latest version ('hard mode' above)
« Last Edit: June 17, 2018, 10:35:25 am by Kiriririn »

mifritscher

  • Newbie
  • *
  • Posts: 23
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #5 on: June 18, 2018, 01:39:39 am »
Switching would be nice for applications like xournal or other painting applications. Perhaps this possible by not replacing, but addding the driver and then disable always one of them via xinput?

Bit its ndeed a good start!

mithrandir

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://www.mygnu.de
Touchscreen as touchpad - relative mouse input
« Reply #6 on: June 18, 2018, 06:47:58 am »
Quote from: mifritscher
Switching would be nice for applications like xournal or other painting applications. Perhaps this possible by not replacing, but addding the driver and then disable always one of them via xinput?

Bit its ndeed a good start!

Tried yesterday, but no success so far. Some applications, i.e.,Chrome work better with the "simple" touch interface. Also for the desktop itself the simple interface seems better with a window manager optimized for touch (unsure which one to use). But many applications or parts of it are nearly unusable without control of the mouse pointer. Therefore switching would be great.

psionlover

  • Newbie
  • *
  • Posts: 34
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #7 on: June 25, 2018, 07:07:19 pm »
Quote from: Kiriririn
A video is worth 1000 words:

https://www.youtube.com/watch?v=bsJn3eMvG7w

tl;dw this technique changes the touchscreen from an absolute mode touchscreen (which is too fiddly for full linux desktop use) into a relative mode touchpad like on most laptops
Thanks very much, this makes the gebian much better to handle. I only don't get a grip on the dragging, sometimes it works but mostly not.

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #8 on: June 26, 2018, 06:51:06 am »
Quote from: psionlover
Quote from: Kiriririn
A video is worth 1000 words:

https://www.youtube.com/watch?v=bsJn3eMvG7w

tl;dw this technique changes the touchscreen from an absolute mode touchscreen (which is too fiddly for full linux desktop use) into a relative mode touchpad like on most laptops
Thanks very much, this makes the gebian much better to handle. I only don't get a grip on the dragging, sometimes it works but mostly not.

The most consistent dragging is by holding one finger and moving another.

Annoyingly the synaptics-style 'double tap but drag rather than releasing the second tap' gesture doesn't work right in mtrack as it emits the first tap, preventing dragging anything that might react to a single tap.

psionlover

  • Newbie
  • *
  • Posts: 34
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #9 on: June 27, 2018, 01:07:47 pm »
Quote from: Kiriririn
The most consistent dragging is by holding one finger and moving another.
Dooesn't work with my version of fingers   But found a more consistent workaround for my fingers: Alt + tap-drag  
« Last Edit: June 27, 2018, 01:10:48 pm by psionlover »

abgd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #10 on: July 10, 2018, 09:33:08 pm »
Works really well. Thanks very much for this tip.

Varti

  • Administrator
  • Hero Member
  • *****
  • Posts: 1266
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #11 on: July 11, 2018, 04:48:18 am »
Quote from: abgd
Works really well. Thanks very much for this tip.
Thanks from me too, I'll definitively use it once I'll install Gemian.

Varti
Planet Gemini PDA WiFi/LTE with Mediatek x27
SL-C1000 running Arch Linux ARM May2017, K30225 Wi-Fi CF Card, 64GB SDXC card
and many other Zauruses!

Alexi Pistonrod

  • Newbie
  • *
  • Posts: 3
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #12 on: September 19, 2018, 03:46:47 pm »
Quote from: Kiriririn
A video is worth 1000 words:

https://www.youtube.com/watch?v=bsJn3eMvG7w

tl;dw this technique changes the touchscreen from an absolute mode touchscreen (which is too fiddly for full linux desktop use) into a relative mode touchpad like on most laptops


Easy mode:
  • sudo apt install xserver-xorg-input-mtrack
  • Edit /usr/share/X11/xorg.conf.d/40-libinput.conf, find:
    Code: [Select]
    Section "InputClass"
            Identifier "libinput touchscreen catchall"
            MatchIsTouchscreen "on"
            MatchDevicePath "/dev/input/event*"
            Driver "libinput"
    EndSection
    Replace with:
    Code: [Select]
    Section "InputClass"
            Identifier "libinput touchscreen catchall"
            MatchIsTouchscreen "on"
            MatchDevicePath "/dev/input/event*"
            Driver "mtrack"
            Option "ScrollDistance" "40"
            Option "FingerLow" "1"
            Option "FingerHigh" "2"
            Option "Sensitivity" "1.8"
            Option "BottomEdge" "0"
            Option "SwipeDistance" "100"
            Option "ScaleDistance" "40"
            Option "ButtonMoveEmulate" "false"
            Option "ClickTime" "25"
            Option "MaxTapMove" "55"
            Option "EdgeBottomSize" "0"
    EndSection
  • sudo systemctl restart sddm or reboot
  • Recommended to disable acceleration in the LXQT mouse settings GUI
Hard mode:

(Instead of installing mtrack from debian repos, there is an improved version that must be built from source...)
  • Config edit as above
  • Enter a suitable empty directory
  • Install the standard debian build tools
  • sudo apt install xserver-xorg-dev libmtdev-dev xutils-dev
  • git clone https://github.com/p2rkw/xf86-input-mtrack
  • cd into the downloaded folder
  • ./configure --prefix=/usr
  • dpkg-buildpackage -uc -us
  • cd ..
  • sudo dpkg -i xserver-xorg-input-mtrack_0.5.0_arm64.deb
  • sudo systemctl restart sddm or reboot
  • Recommended to disable acceleration in the LXQT mouse settings GUI



Thanks for this , applied it and it is great however there seem to be many many options we can use to tweak the driver and I am not clear how to click and drag accurately.

How much have you experimented with the settings?

Kiriririn

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #13 on: September 19, 2018, 07:55:19 pm »
Quote from: Alexi Pistonrod
Thanks for this , applied it and it is great however there seem to be many many options we can use to tweak the driver and I am not clear how to click and drag accurately.

How much have you experimented with the settings?

For click and drag, touch and hold with one finger, then add a second finger anywhere on the screen and drag with the second finger, keeping the first finger stationary

Unfortunately the 'synaptics-style' click and drag (where you double tap but start dragging on the second tap) doesn't work reliably as it emits a click from the first tap (presumably to avoid input lag)
« Last Edit: September 19, 2018, 07:57:02 pm by Kiriririn »

gemini_user_j

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Touchscreen as touchpad - relative mouse input
« Reply #14 on: November 03, 2018, 12:35:02 pm »
Quote from: Kiriririn
  • Edit /usr/share/X11/xorg.conf.d/40-libinput.conf, find:
This is amazing!

I have two practical questions, if anyone knows:

1) Is it possible to switch between original behaviour, and the one you enabled by switching between two versions or the file I quoted above?

2) Is it possible to flip the scrolling direction?
Gemini PDA x27