Re: [問題] 如何設定滑鼠"點選鎖定(長按)"功能

作者: Gold740716 (項為之強)   2020-03-16 13:18:23
我是直接寫一個新文件丟到 xorg.conf.d 下,
如果 /etc/X11/xorg.conf.d 不存在的話,
就試試看放 /usr/share/X11/xorg.conf.d 有沒效,
不然就自己建立 /etc/X11/xorg.conf.d 。
像這是我的:
```
Section "InputClass"
Identifier "effecient touch pad"
MatchProduct "Touchpad"
Driver "libinput"
# below property in man-page libinput(4)
Option "TappingDrag" "True"
Option "Tapping" "True"
Option "AccelProfile" "adaptive"
Option "AccelSpeed" "1.0"
EndSection
```
Identifier 似乎是自己取一個不和其它 section 重復的名字即可。
然後會依 MatchProduct 尋找對應的裝置。
例如我的 xinput list 的輸出:
```
Virtual core pointer id=2 [master pointer (3)]
Virtual core XTEST pointer id=4 [slave pointer (2)]
ETPS/2 Elantech Touchpad id=12 [slave pointer (2)]
ETPS/2 Elantech TrackPoint id=13 [slave pointer (2)]
UFO-MSW-BT730 id=15 [slave pointer (2)]
Virtual core keyboard id=3 [master keyboard (2)]
Virtual core XTEST keyboard id=5 [slave keyboard (3)]
Power Button id=6 [slave keyboard (3)]
Video Bus id=7 [slave keyboard (3)]
Power Button id=8 [slave keyboard (3)]
Sleep Button id=9 [slave keyboard (3)]
Integrated Camera: Integrated C id=10 [slave keyboard (3)]
AT Translated Set 2 keyboard id=11 [slave keyboard (3)]
ThinkPad Extra Buttons id=14 [slave keyboard (3)]
```
其中 id 12 的名字裡有 TouchPad,
所以該 section 內的設定就會在 id 12 裝置上生效。
修改設定檔後,要重啟 xserver 才會生效。
如果是 gdm : systemctl restart gdm
lightdm : systemctl restart lightdm
可能要登出 x window ,
用 ctrl-alt-f2 切到 tty 下操作比較好。
至於直接用 xinput set-prop 設定,
我也不確定。
※ 引述《upufuxup (HelloRain)》之銘言:
: 之前有好心的人跟我說可以看
: evdev 的 DragLockButtons , /etc/X11/xorg.conf.d/
: 或是libinput
: 我看了這份文件
: https://tinyurl.com/qooofev
: 還是不懂DragLockButtons的說明
: 它寫說如果只設一個值,代表"meta" locking button
: 設一對值,代表第一個值為lock button第二個值為logical button number
: 我想要設定滑鼠左鍵為DragLockButtons
: 我的設定文件似乎都是在/usr/share/X11/xorg.conf.d下
: 在/etc/X11下並沒有xorg.conf.d資料夾
: 但是我找不到"Log"Logitech USB Optical Mouse"的設定檔在哪
: 在目錄下用grep找也找不到
: 另外我從xinput list-props 9中沒看到ButtonMapping
: 所以參照下面這份文件試著用xinput set-prop來設定
: 也完全沒作用
: https://wiki.archlinux.org/index.php/Logitech_Marble_Mouse
: 請問該怎麼設才對?
: 謝謝
: 以下是我的Ubuntu xinput list畫面
: [email protected]:~# xinput list
: Virtual core pointer id=2 [master pointer (3)]
: Virtual core XTEST pointer id=4 [slave
: pointer (2)]
: Logitech USB Optical Mouse id=9 [slave
: pointer (2)]
: ATEN UC-10KM V1.3.124 id=12 [slave
: pointer (2)]
: Virtual core keyboard id=3 [master keyboard (2)]
: Virtual core XTEST keyboard id=5 [slave
: keyboard (3)]
: Power Button id=6 [slave
: keyboard (3)]
: Video Bus id=7 [slave
: keyboard (3)]
: Power Button id=8 [slave
: keyboard (3)]
: ATEN UC-10KM V1.3.124 id=10 [slave
: keyboard (3)]
: Chicony USB Keyboard id=11 [slave
: keyboard (3)]
: Chicony USB Keyboard id=13 [slave
: keyboard (3)]
: [email protected]:~# xinput list-props 9
: Device 'Logitech USB Optical Mouse':
: Device Enabled (133): 1
: Coordinate Transformation Matrix (135): 1.000000, 0.000000, 0.000000,
: 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
: Device Accel Profile (260): 0
: Device Accel Constant Deceleration (261): 1.000000
: Device Accel Adaptive Deceleration (262): 1.000000
: Device Accel Velocity Scaling (263): 10.000000
: Device Product ID (250): 1133, 49271
: Device Node (251): "/dev/input/event4"
: Evdev Axis Inversion (264): 0, 0
: Evdev Axes Swap (266): 0
: Axis Labels (267): "Rel X" (143), "Rel Y" (144), "Rel Vert Wheel" (259)
: Button Labels (268): "Button Left" (136), "Button Middle" (137),
: "Button Right" (138), "Button Wheel Up" (139), "Button Wheel Down" (140),
: "Button Horiz Wheel Left" (141), "Button Horiz Wheel Right" (142), "Button
: Side" (254), "Button Extra" (255), "Button Forward" (256), "Button Back"
: (257), "Button Task" (258), "Button Unknown" (253), "Button Unknown" (253),
: "Button Unknown" (253), "Button Unknown" (253)
: Evdev Scrolling Distance (269): 1, 1, 1
: Evdev Middle Button Emulation (270): 0
: Evdev Middle Button Timeout (271): 50
: Evdev Third Button Emulation (272): 0
: Evdev Third Button Emulation Timeout (273): 1000
: Evdev Third Button Emulation Button (274): 3
: Evdev Third Button Emulation Threshold (275): 20
: Evdev Wheel Emulation (276): 0
: Evdev Wheel Emulation Axes (277): 0, 0, 4, 5
: Evdev Wheel Emulation Inertia (278): 10
: Evdev Wheel Emulation Timeout (279): 200
: Evdev Wheel Emulation Button (280): 4
: Evdev Drag Lock Buttons (281): 0
: 我不曉得Drag Lock Buttons要怎麼設定才是正確的?也有試過其他數字
: 如果設定xinput set-prop 9 281 136
: 會顯示BadValue(integer parameter out of range for operation)
: [email protected]:~# xinput set-prop 9 281 2 2 (無作用)
: [email protected]:/usr/share/X11/xorg.conf.d# ls
: 10-amdgpu.conf 10-quirks.conf 11-evdev-trackpoint.conf
: 50-vmmouse.conf 51-synaptics-quirks.conf
: 10-evdev.conf 11-evdev-quirks.conf 50-synaptics.conf 50-wacom.conf
: ※ 引述《upufuxup (HelloRain)》之銘言:
: : Windows 的滑鼠設定裡,可以啟動"點選鎖定",
: : 讓使用者在反白或拖曳時,不須一直按著滑鼠,
: : 只要按一下滑鼠鍵,放開,再按一次滑鼠鍵即可
: : 我想要在Ubuntu裡也啟用這個功能
: : 我查了imwheel跟xmodmap的設定教學,可是都找不到怎麼設定"點選鎖定"
: : 請問有甚麼方法可以在Ubuntu上設定滑鼠"點選鎖定"?
: : 謝謝
作者: foo (大牛)   0000-00-00 00:00:00
這作者……
作者: void ( avoid)   0000-00-00 00:00:00
奇文共賞!!
作者: DreamBBS   2020-03-16 23:12:00
真。站簽請用 https://i.imgur.com/1VwZTrB.png 謝謝!
作者: brli7848 (無理阿?)   2020-03-17 16:04:00
先拜為敬

Links booklink

Contact Us: admin [ a t ] ucptt.com