====== Configure X11 Touchscreen Gestures ====== NOTE: The techniques and methods described below do not work in Wayland. ===== Installing the evdev Dependency ===== The following configurations require the evdev. If it is not already installed, install it with ''sudo apt install xserver-xorg-input-evdev''. For more information about the evdev options and their syntax please see the [[https://manpages.debian.org/stable/xserver-xorg-input-evdev/evdev.4.en.html|evdev manpage]] and the [[https://www.x.org/releases/current/doc/man/man5/xorg.conf.5.xhtml#heading9|InputClass configuration options]]. ===== Add a long-touch right-click gesture ===== The following procedure will configure X Windows so a long-touch (touch and hold) will simulate a right-click and display a context menu. - Create the file ///etc/X11/xorg.conf.d/90-touch-gestures.conf// with the following contents: Section "InputClass" Identifier "touch gestures" Driver "evdev" MatchProduct "Microchip Technology Inc. AR1100 HID-MOUSE" Option "EmulateThirdButton" "1" Option "EmulateThirdButtonTimeout" "750" Option "EmulateThirdButtonMoveThreshold" "50" EndSection - Reboot {{ :comfilepi:right_click.mp4?600x338 |}} In Mono applications, this feature can cause the MouseDown event to delay. If your application depends on an immediate MouseDown event, please delete the file ///etc/X11/xorg.conf.d/90-right-click.conf//. ===== Add a touch-and-drag scroll gesture ===== The following procedure will configure X Windows so when you touch and drag your finger up and down the touchscreen it will scroll. - Create the file ///etc/X11/xorg.conf.d/90-touch-gestures.conf// with the following contents: Section "InputClass" Identifier "touch gestures" Driver "evdev" MatchProduct "Microchip Technology Inc. AR1100 HID-MOUSE" Option "EmulateWheel" "1" Option "EmulateWheelButton" "1" Option "EmulateWheelInertia" "10" Option "EmulateWheelTimeout" "200" Option "YAxisMapping" "4 5" EndSection - Reboot {{ :comfilepi:roll.mp4?600x338 |}}
"EmulateWheelInertia" "10"
{{ :comfilepi:drag.mp4?600x338 |}}
"EmulateWheelInertia" "100"
Use Option "YAxisMapping" "5 4" to invert the scroll direction.