如何設定滑鼠"點選鎖定(長按)"功能 - Linux

Poppy avatar
By Poppy
at 2020-03-16T13:18

Table of Contents

我是直接寫一個新文件丟到 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畫面
: root@sw-Veriton-M4610:~# 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)]
: root@sw-Veriton-M4610:~# 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)
: root@sw-Veriton-M4610:~# xinput set-prop 9 281 2 2 (無作用)
: root@sw-Veriton-M4610:/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上設定滑鼠"點選鎖定"?
: : 謝謝

--
sent from mySQL.
--
※ 發信站: 夢之大地 (ccns.cc), 來自: 140.116.249.140
※ 文章網址: telnet://ccns.cc/
foo: 這作者……02/30 22:66
void: 奇文共賞!!02/30 28:19

--
Tags: Linux

All Comments

Frederica avatar
By Frederica
at 2020-03-17T09:18
這作者……
Isabella avatar
By Isabella
at 2020-03-19T21:29
奇文共賞!!
Wallis avatar
By Wallis
at 2020-03-22T07:52
真。站簽請用 https://i.imgur.com/1VwZTrB.png 謝謝!
Aaliyah avatar
By Aaliyah
at 2020-03-22T21:07
先拜為敬

如何設定滑鼠"點選鎖定(長按)"功能

Callum avatar
By Callum
at 2020-03-16T12:23
之前有好心的人跟我說可以看 evdev 的 DragLockButtons , /etc/X11/xorg.conf.d/ 或是libinput 我看了這份文件 https://tinyurl.com/qooofev 還是不懂DragLockButtons的說明 它寫說如果只設一個值,代表and#34;me ...

USB硬碟上的ubuntu接到其他主機

Puput avatar
By Puput
at 2020-03-15T13:15
想請教各位, 我本來的舊windows筆電有另外用行動硬碟灌ubuntu, 需要用linux的時候就用行動硬碟開機。 因為看到以前有些人也是把linux灌在行動硬碟上, 還可以帶去其他電腦開機, 最近換了新筆電之後,我就試著使用該ubuntu行動硬碟開機, 結果連usb開機都沒辦法 ...

外接螢幕問題

Erin avatar
By Erin
at 2020-03-14T18:56
已經爬過文但是跟我情況好像都不太符合 今天剛灌好ubuntu以後發現外接的螢幕只有滑鼠游標 把其他視窗拖過去也只剩游標而已 不知道問題在哪 - ...

WSL Ubuntu 沒反應

Robert avatar
By Robert
at 2020-03-14T17:14
https://i.imgur.com/dzkoXLF.jpg 最近剛學Linux 發現常常在套件安裝到一半或是輸入指令後 就沒反應了。 之後當我在敲打鍵盤時,就會有最後兩行的字。 嘗試關掉Ubuntu 重開,就進不去Linux系統了。 都必須把電腦整個重開才能再次使用ubuntu進入Linux ...

AMD GPU安裝ROCM套件失敗

Erin avatar
By Erin
at 2020-03-13T18:10
hi,想請問各位大大是否有在AMD GPU平台上跑深度學習的經驗? 小弟目前卡死在安裝ROCM這個套件, 我按照官方文件(如連結1)的步驟安裝 $ wget -q0 – http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-k e ...