升级15.5版本后触摸板三指如何还原为中指操作?
Tofloor
poster avatar
DebuggerX
deepin
2017-12-02 05:37
Author
刚刚给手里的小米笔记本13升级了15.5,发现手势这一块改动挺大,看到/usr/share/dde-daemon下的文件,现在是把一些窗管内置操作提供给了手势直接调用。
其中那个三指点击默认为进入移动窗口模式,然而我并不需要这个操作,相反原本三指触发单击中键的操作我用的很多,想问下现在有没有办法还原成原来的操作。
我已近试着把gesture.json里三指单击的定义段直接删掉了,然而结果是现在三指单击既不响应为中键也不触发窗口移动。
是因为现在三指的操作直接被拦截掉了么?不管怎么改Synaptics的配置三指都不能按照我设定的按键响应,这一块的开发同学能给解答下么?
@jingle

Reply Favorite View the author
All Replies
avatar
DebuggerX
deepin
2017-12-05 01:14
#1
不知道是不是开发同学没看到所以再顶一下~~
其实我现在给三指绑定了xdotool click 2这个cmdline也是能满足使用要求的,但是还是想听听看法同学的专业意见……
Reply View the author
avatar
quadpixels
deepin
2017-12-05 12:47
#2
本帖最后由 quadpixels 于 2017-12-5 13:00 编辑
https://bbs.deepin.org/post/149387
不知道是不是开发同学没看到所以再顶一下~~
其实我现在给三指绑定了xdotool click 2这个cmdline也是能满 ...

好像Deepin默认是用的libinput,不是synaptics了诶
如果想查看的话可以用xinput命令。譬如说在我的PC上有一个USB无线鼠标,一个触摸板,其中触摸板我强制使用了synaptics。

首先拿到设备的ID。
  1. $ xinput
  2. ⎡ Virtual core pointer                            id=2        [master pointer  (3)]
  3. ⎜   ↳ Virtual core XTEST pointer                      id=4        [slave  pointer  (2)]
  4. ⎜   ↳ Logitech Unifying Device. Wireless PID:4026        id=10        [slave  pointer  (2)]
  5. ⎜   ↳ Logitech Unifying Device. Wireless PID:4026        id=11        [slave  pointer  (2)]
  6. ⎜   ↳ SynPS/2 Synaptics TouchPad                      id=14        [slave  pointer  (2)]
  7. ⎜   ↳ TPPS/2 IBM TrackPoint                           id=15        [slave  pointer  (2)]
  8. ⎣ Virtual core keyboard                           id=3        [master keyboard (2)]
  9.   ...
Copy the Code


查看USB鼠标,就是id=10的设备:
  1. $ xinput list-props 10
  2. Device 'Logitech Unifying Device. Wireless PID:4026':
  3.         Device Enabled (141):        1
  4.         Coordinate Transformation Matrix (143):        1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
  5.         libinput Accel Speed (276):        0.333333
  6.         libinput Accel Speed Default (277):        0.000000
  7.         libinput Accel Profiles Available (278):        1, 1
  8. ...
Copy the Code

注意其中的属性都是 libinput 开头的

而如果是触摸板,就是id=14的设备
  1. $ xinput list-props 14
  2. Device 'SynPS/2 Synaptics TouchPad':
  3.        ...
  4.         Synaptics Tap Time (296):        120
  5.         Synaptics Tap Move (297):        247
  6. ...
Copy the Code

属性都是synaptics开头的,说明使用的X驱动是synaptics

如果想要强制使用synaptics,可以编辑系统全局的配置文件,应该是/etc下面的某个目录…… 记得当时好像我是把70-libinput.conf这个文件删掉了。
Reply View the author
avatar
DebuggerX
deepin
2017-12-05 18:43
#3
https://bbs.deepin.org/post/149387
Deepin默认是用的libinput,不是synaptics了吧!
如果想查看的话可以用xinput命令。譬如说在我的PC上有一 ...

恩,我想应该不是驱动的问题,因为我去手动更改/etc/X11/xorg.conf.d/50-synaptics.conf这个配置文件的时候,或者用synclient修改属性的时候触摸板的某些行为确实是发生了改变,唯独只有三指这个操作对应的行为不会触发,所以才怀疑是不是哪里被拦截了(我以前是搞移动开发的,所以有触摸事件拦截这个说法,不知道用到这里合适不合适)。

触摸板现在xinput的输出如下:

  1. debuggerx@debuggerx-mi:~$ xinput list-props 12
  2. Device 'SynPS/2 Synaptics TouchPad':
  3.         Device Enabled (140):        1
  4.         Coordinate Transformation Matrix (142):        1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
  5.         Device Accel Profile (268):        1
  6.         Device Accel Constant Deceleration (269):        1.600000
  7.         Device Accel Adaptive Deceleration (270):        1.000000
  8.         Device Accel Velocity Scaling (271):        10.000000
  9.         Synaptics Edges (272):        500, 5400, 2000, 4000
  10.         Synaptics Finger (273):        25, 30, 0
  11.         Synaptics Tap Time (274):        180
  12.         Synaptics Tap Move (275):        247
  13.         Synaptics Tap Durations (276):        180, 180, 100
  14.         Synaptics ClickPad (277):        1
  15.         Synaptics Middle Button Timeout (278):        0
  16.         Synaptics Two-Finger Pressure (279):        282
  17.         Synaptics Two-Finger Width (280):        7
  18.         Synaptics Scrolling Distance (281):        112, 112
  19.         Synaptics Edge Scrolling (282):        1, 1, 0
  20.         Synaptics Two-Finger Scrolling (283):        1, 1
  21.         Synaptics Move Speed (284):        1.000000, 1.750000, 0.035499, 0.000000
  22.         Synaptics Off (285):        2
  23.         Synaptics Locked Drags (286):        0
  24.         Synaptics Locked Drags Timeout (287):        5000
  25.         Synaptics Tap Action (288):        8, 9, 0, 0, 1, 3, 0
  26.         Synaptics Click Action (289):        1, 3, 2
  27.         Synaptics Circular Scrolling (290):        0
  28.         Synaptics Circular Scrolling Distance (291):        0.100000
  29.         Synaptics Circular Scrolling Trigger (292):        0
  30.         Synaptics Circular Pad (293):        0
  31.         Synaptics Palm Detection (294):        0
  32.         Synaptics Palm Dimensions (295):        6, 50
  33.         Synaptics Coasting Speed (296):        20.000000, 50.000000
  34.         Synaptics Pressure Motion (297):        30, 160
  35.         Synaptics Pressure Motion Factor (298):        1.000000, 1.000000
  36.         Synaptics Grab Event Device (299):        0
  37.         Synaptics Gestures (300):        1
  38.         Synaptics Capabilities (301):        1, 0, 0, 1, 1, 1, 1
  39.         Synaptics Pad Resolution (302):        56, 41
  40.         Synaptics Area (303):        0, 0, 0, 0
  41.         Synaptics Soft Button Areas (304):        3470, 0, 4061, 0, 0, 0, 0, 0
  42.         Synaptics Noise Cancellation (305):        28, 28
  43.         Device Product ID (264):        2, 7
  44.         Device Node (263):        "/dev/input/event6"
Copy the Code


我根据文档尝试了修改Tap Action和Click Action的值,但是没有得到预期的效果。。
Reply View the author
avatar
quadpixels
deepin
2017-12-05 21:03
#4
本帖最后由 quadpixels 于 2017-12-5 13:09 编辑

咦,楼主的synaptics的“capabilities”一栏的确是说能检测出三指的(参 https://wiki.archlinux.org/index.php/Touchpad_Synaptics )(倒数第三个数是1就表示支持)

不知道执行xev这个命令后,在弹出的窗口中用三指去轻触触摸板,会不会有中键点击的提示:
  1. ButtonPress event, serial 37, synthetic NO, window 0x9000001,
  2.     root 0x129, subw 0x0, time 210141716, (127,95), root:(210,167),
  3.     state 0x0, button 2, same_screen YES

  4. ButtonRelease event, serial 37, synthetic NO, window 0x9000001,
  5.     root 0x129, subw 0x0, time 210141816, (127,95), root:(210,167),
  6.     state 0x200, button 2, same_screen YES
Copy the Code
Reply View the author
avatar
DebuggerX
deepin
2017-12-05 21:30
#5
https://bbs.deepin.org/post/149387
咦,楼主的synaptics的“capabilities”一栏的确是说能检测出三指的(参 https://wiki.archlinux.org/index ...

对啊,原本就是支持的,这次更新之前一直默认三指中键没毛病的。
是这次更新后三指被自定义了,然后我把三指点击的配置项删除后没有恢复成中键所以我发上来问问的。
现在我是自己配了这样一条,可以达到继续三指中键的效果(这时候xev也能得到button2事件的):



如果不加这条的话就没反应了,xev也是,单指双值会显示button1和button3,三指没有反馈。
Reply View the author
avatar
melodyzou
deepin
2017-12-05 22:25
#6
https://bbs.deepin.org/post/149387
对啊,原本就是支持的,这次更新之前一直默认三指中键没毛病的。
是这次更新后三指被自定义了,然后我把 ...

因为15.5启用了tap gesture,所以禁用了三指tap button,如果需要的话,就使用 xinput 命令去设置
Reply View the author
avatar
DebuggerX
deepin
2017-12-05 23:42
#7
https://bbs.deepin.org/post/149387
因为15.5启用了tap gesture,所以禁用了三指tap button,如果需要的话,就使用 xinput 命令去设置
...

虽然已经用设置命令发送按键的方式解决使用问题了,不过还是想知道如果要用xinput设置具体是要怎么做,望详解~~
Reply View the author
avatar
melodyzou
deepin
2017-12-06 00:52
#8
https://bbs.deepin.org/post/149387
虽然已经用设置命令发送按键的方式解决使用问题了,不过还是想知道如果要用xinput设置具体是要怎么做,望 ...

安装 xinput 然后执行 xinput 去找到你想要修改的设备的 id,然后使用 'xinput list-props ' 得到此设备支持的属性,然后执行 "xinput set-prop " 来设置属性,有时 value 会有多个,设备属性中可以看到。


Reply View the author
avatar
yanbowen
deepin
Community Developer
2017-12-06 01:11
#9
https://bbs.deepin.org/post/149387
man xinput 查看文档, 根据设备不同,传入的 id 不同,需要自行看文档设置
@yanbowen 大神麻烦说一说 ...

安装 xinput 然后执行 xinput 去找到你想要修改的设备的 id,然后使用 'xinput list-props ' 得到此设备支持的属性,然后执行 "xinput set-prop " 来设置属性,有时 value 会有多个,设备属性中可以看到.

已触摸板的 id 为 12 为例,命令就是:xinput set-prop 12 'Synaptics Tap Action' 0 0 0 0 1 3 2
另外还需要禁用手势功能: gsettings set com.deepin.dde.daemon gesture false

触摸板属性的文档见:ftp://www.x.org/pub/X11R7.5/doc/man/man4/synaptics.4.html
Reply View the author
avatar
DebuggerX
deepin
2017-12-06 18:50
#10
https://bbs.deepin.org/post/149387
安装 xinput 然后执行 xinput 去找到你想要修改的设备的 id,然后使用 'xinput list-props ' 得到此设备 ...

确实,按你说的禁用了dde.daemon的gesture后就可以了。
就是确定下,上面也说了现在用xdotool命令发送按键效果也是一样的,而且新版手势确实比上一版好用很多~~
Reply View the author