在 Windows 中,我可以根据需要配置 Synaptics TouchPad(和 TouchStyk)硬件点击按钮的操作。如何在 Kubuntu 中执行此操作?设置中没有触摸板按钮的选项。我只能交换鼠标按钮,并模拟触摸板角落的点击,这不是我想要的。我想将触摸板下方的右键单击硬件按钮更改为中键单击。
我的笔记本是像这张图这样的型号:HP EliteBook 850 G2。如您所见,上面有 2 个按钮(用于“TouchStyk”/指点杆),下面有 2 个按钮(用于 TouchPad)。我只想更改右下角的按钮,并保留其他按钮。
我该如何设置?我需要安装什么东西吗?如果没有实现,我应该在哪里发布问题报告来请求此功能?
我在命令行上运行了它,但我认为它没有帮助。有Synaptics Click Action (338): 1, 1, 0
,但info synaptics
似乎表明它是用于点击板的(我的不是点击板)。
顺便说一句,我认为PS/2 Generic Mouse
可能是它如何在没有特定驱动程序实现的情况下识别“TouchStyk”(指点杆)。(但这并不重要,因为我希望能够更改的按钮主要是下面的按钮,即触摸板按钮)。
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ [...]
⎜ ↳ PS/2 Generic Mouse id=17 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=18 [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)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ [...]
$ xinput list-props 18
Device 'SynPS/2 Synaptics TouchPad':
Device Enabled (165): 1
Coordinate Transformation Matrix (167): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (298): 1
Device Accel Constant Deceleration (299): 2.500000
Device Accel Adaptive Deceleration (300): 1.000000
Device Accel Velocity Scaling (301): 12.500000
Synaptics Edges (321): 1661, 5367, 1412, 4510
Synaptics Finger (322): 25, 30, 0
Synaptics Tap Time (323): 180
Synaptics Tap Move (324): 246
Synaptics Tap Durations (325): 180, 180, 100
Synaptics ClickPad (326): 0
Synaptics Middle Button Timeout (327): 75
Synaptics Two-Finger Pressure (328): 282
Synaptics Two-Finger Width (329): 7
Synaptics Scrolling Distance (330): 112, 112
Synaptics Edge Scrolling (331): 0, 1, 0
Synaptics Two-Finger Scrolling (332): 1, 0
Synaptics Move Speed (333): 1.000000, 1.750000, 0.035619, 0.000000
Synaptics Off (334): 0
Synaptics Locked Drags (335): 1
Synaptics Locked Drags Timeout (336): 250
Synaptics Tap Action (337): 0, 0, 0, 0, 1, 2, 0
Synaptics Click Action (338): 1, 1, 0
Synaptics Circular Scrolling (339): 0
Synaptics Circular Scrolling Distance (340): 0.100007
Synaptics Circular Scrolling Trigger (341): 0
Synaptics Circular Pad (342): 0
Synaptics Palm Detection (343): 0
Synaptics Palm Dimensions (344): 10, 200
Synaptics Coasting Speed (345): 1.000000, 50.000000
Synaptics Pressure Motion (346): 30, 225
Synaptics Pressure Motion Factor (347): 1.000000, 2.000000
Synaptics Resolution Detect (348): 1
Synaptics Grab Event Device (349): 0
Synaptics Gestures (350): 1
Synaptics Capabilities (351): 1, 0, 1, 1, 1, 1, 1
Synaptics Pad Resolution (352): 70, 43
Synaptics Area (353): 0, 0, 0, 0
Synaptics Noise Cancellation (354): 28, 28
Device Product ID (291): 2, 7
Device Node (290): "/dev/input/event7"
$ synclient -l
Parameter settings:
LeftEdge = 1661
RightEdge = 5367
TopEdge = 1412
BottomEdge = 4510
FingerLow = 25
FingerHigh = 30
MaxTapTime = 180
MaxTapMove = 246
MaxDoubleTapTime = 180
SingleTapTimeout = 180
ClickTime = 100
EmulateMidButtonTime = 75
EmulateTwoFingerMinZ = 282
EmulateTwoFingerMinW = 7
VertScrollDelta = 112
HorizScrollDelta = 112
VertEdgeScroll = 0
HorizEdgeScroll = 1
CornerCoasting = 0
VertTwoFingerScroll = 1
HorizTwoFingerScroll = 0
MinSpeed = 1
MaxSpeed = 1.75
AccelFactor = 0.0356189
TouchpadOff = 0
LockedDrags = 1
LockedDragTimeout = 250
RTCornerButton = 0
RBCornerButton = 0
LTCornerButton = 0
LBCornerButton = 0
TapButton1 = 1
TapButton2 = 2
TapButton3 = 0
ClickFinger1 = 1
ClickFinger2 = 1
ClickFinger3 = 0
CircularScrolling = 0
CircScrollDelta = 0.100007
CircScrollTrigger = 0
CircularPad = 0
PalmDetect = 0
PalmMinWidth = 10
PalmMinZ = 200
CoastingSpeed = 1
CoastingFriction = 50
PressureMotionMinZ = 30
PressureMotionMaxZ = 225
PressureMotionMinFactor = 1
PressureMotionMaxFactor = 2
ResolutionDetect = 1
GrabEventDevice = 0
TapAndDragGesture = 1
AreaLeftEdge = 0
AreaRightEdge = 0
AreaTopEdge = 0
AreaBottomEdge = 0
HorizHysteresis = 28
VertHysteresis = 28
ClickPad = 0
$ apt list *input* --installed
Listing... Pronto
inputattach/focal,now 1:1.7.0-1 amd64 [installed,automatic]
libinput-bin/focal-updates,now 1.15.5-1ubuntu0.2 amd64 [installed,automatic]
libinput10/focal-updates,now 1.15.5-1ubuntu0.2 amd64 [installed,automatic]
libqt5hunspellinputmethod5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libxcb-xinput0/focal,now 1.14-2 amd64 [installed,automatic]
xinput/focal,now 1.6.3-1 amd64 [installed,automatic]
xserver-xorg-input-all/focal,now 1:7.7+19ubuntu14 amd64 [installed,automatic]
xserver-xorg-input-libinput/focal,now 0.29.0-1 amd64 [installed,automatic]
xserver-xorg-input-synaptics/focal,now 1.9.1-1ubuntu3 amd64 [installed]
xserver-xorg-input-wacom/focal,now 1:0.39.0-0ubuntu1 amd64 [installed,automatic]
答案1
已采取指示来自这篇文章。您可以使用 重新映射按钮xinput set-button-map
。
有趣的是,文章声称这在 Wayland 上也应该有效,只是按钮映射可能不同,所以你需要重新配置它。另外,请注意,此命令的结果仅在你重新启动之前有效,因此你需要将命令添加到自动启动中。虽然在 X11 上,你也可以使用 X11 配置文件进行设置,但在我看来它们太复杂了,所以我的建议是:只需将命令添加到自动启动中即可。
最后,请不要xinput
像在帖子中那样使用数字标识符。这些标识符可能因重新启动而异,因此有时您可能会在错误的设备上设置属性。请改用字符串标识符,如下所示。
为了保持一致性,我将使用来自我的系统的示例。
首先,列出设备,并找出哪一个是你的触摸板:
λ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ A4TECH USB Device Consumer Control id=15 [slave pointer (2)]
⎜ ↳ A4TECH USB Device id=16 [slave pointer (2)]
⎜ ↳ DELL0768:00 06CB:7E92 Mouse id=18 [slave pointer (2)]
⎜ ↳ DELL0768:00 06CB:7E92 Touchpad id=19 [slave pointer (2)]
⎜ ↳ Microsoft Wired Keyboard 600 Consumer Control id=11 [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)]
↳ A4TECH USB Device Keyboard id=13 [slave keyboard (3)]
↳ A4TECH USB Device System Control id=14 [slave keyboard (3)]
↳ Integrated_Webcam_HD: Integrate id=17 [slave keyboard (3)]
↳ Dell WMI hotkeys id=20 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=21 [slave keyboard (3)]
↳ DELL Wireless hotkeys id=22 [slave keyboard (3)]
↳ A4TECH USB Device Consumer Control id=24 [slave keyboard (3)]
↳ Microsoft Wired Keyboard 600 id=10 [slave keyboard (3)]
↳ Microsoft Wired Keyboard 600 Consumer Control id=12 [slave keyboard (3)]
↳ Microsoft Wired Keyboard 600 System Control id=23 [slave keyboard (3)]
这里的触摸板是DELL0768:00 06CB:7E92 Touchpad
。现在我们来看看它的按键图:
λ xinput get-button-map "DELL0768:00 06CB:7E92 Touchpad"
1 2 3 4 5 6 7
根据我的理解,索引的含义可能有所不同。要找到哪些按钮映射到哪个索引,您必须执行xev
应用程序,并尝试按下触摸板上的按钮。示例:
λ xev
[…]
ButtonRelease event, serial 35, synthetic NO, window 0x5c00001,
root 0x7ba, subw 0x0, time 1191093641, (148,284), root:(1110,286),
state 0x210, button 2, same_screen YES
ButtonPress event, serial 35, synthetic NO, window 0x5c00001,
root 0x7ba, subw 0x0, time 1191096033, (148,284), root:(1110,286),
state 0x10, button 3, same_screen YES
ButtonRelease event, serial 35, synthetic NO, window 0x5c00001,
root 0x7ba, subw 0x0, time 1191096294, (148,284), root:(1110,286),
state 0x410, button 3, same_screen YES
[…]
在这里你可以button 2
看到button 3
是索引。这些事件是由我按下触摸板中键和右键触发的(需要说明的是:我没有硬件触摸板的中键,而是同时按下左键和右键。另外有趣的是,它是一个点击板,所以……是的,如果有人想知道的话,它也适用于点击板)。
现在,你可以排列按钮了:
λ xinput set-button-map "DELL0768:00 06CB:7E92 Touchpad" 1 3 2 4 5 6 7
瞧!现在每当我按下触摸板上的右键时,我都会收到中键事件。你甚至可以设置,比如说,1 2 2 4 5 6 7
(重复的2
s),因此无法通过触摸板触发右键单击。