Linux的触屏手势软件安装,linux触摸板手势

Loading…

#0x00

这里使用的是`libinput-gestures`,依赖xdotool(模拟鼠标/键盘输入)

“`

sudo pacman -S libinput-gestures xdotool

sudo pacman -S libinput xf86-input-libinput

“`

配置libinput文件(文件名字视情况而定,我的是40-libinput.conf)

“`

sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/40-libinput.conf

“`

下面是文件中touchpad部分的配置:

“`

Section “InputClass”

Identifier “touchpad”

MatchIsTouchpad “on”

MatchDevicePath “/dev/input/event*”

Driver “libinput”

Option “Tapping” “on”

Option “ButtonMapping” “1 3 0 4 5 6 7”

Option “TappingButtonMap” “lmr”

Option “DisableWhileTyping” “on”

Option “TappingDrag” “on”

EndSection

“`

详细参数和解释见[libinput man page: based on X.Org input dirver][1],解释下几个重要的配置参数:

Option “Tapping” “on”:手指点击touchpad发送鼠标点击事件

Option “TappingButtonMap” “lmr”:1个手指点击对应`鼠标左键`,2个手指点击对应`鼠标中键`,3个鼠标点击对应`鼠标右键`。

Option “ButtonMapping” “1 3 0 4 5 6 7″,按钮映射,详情见[libinput#Button_Mapping][2],这里笔者关闭了3指对应的左键。

Option “DisableWhileTyping” “on”:打字时不检测touchpad事件,防止用户不小心触碰touchpad引起不必要的影响。

Option “TappingDrag” “on”:开启点击拖拽。

#0x01

添加当前用户到用户组

“`

sudo gpasswd -a $USER input

“`

复制文件

“`

cp /etc/libinput-gestures.conf ~/.config/

“`

“`

gesture swipe left 4 xdotool key super+Left

# 4指左划: 切换到左侧工作区

gesture swipe right 4 xdotool key super+Right

# 4指右划: 切换到右侧工作区

gesture swipe left 3 xdotool key alt+Left

# 3指左划: 浏览器后退

gesture swipe right 3 xdotool key alt+Right

# 3指右划: 浏览器前进

gesture swipe up 3 xdotool key F5

# 3指上划: 刷新当前页面

gesture swipe down 3 xdotool key ctrl+w

# 3指下划: 关闭当前页面

gesture pinch in 2 xdotool key ctrl+minus

# 2指捏: 缩小

gesture pinch out 2 xdotool key ctrl+plus

# 2指张: 放大

“`

#0x02

启动

“`

libinput-gestures-setup start

“`

END

[1]: https://www.mankier.com/4/libinput#Configuration_Details

[2]: https://www.mankier.com/4/libinput#Button_Mapping

最后修改:2019 年 10 月 24 日 03 : 00 PM

赞赏

如果觉得我的文章对你有用,请随意赞赏

×Close

扫一扫支付

支付宝支付

微信支付

文章知识点与官方知识档案匹配,可进一步学习相关知识CS入门技能树Linux入门在线安装软件24722 人正在系统学习中 相关资源:触摸屏测试软件v2.0免费绿色版_电脑触摸屏测试软件-其它代码类…

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年4月2日
下一篇 2021年4月2日

相关推荐