如何保留触摸板但想停用按钮

man*_*k13 7 opensuse kde touchpad

我孩子的 acer v5 上的右键坏了。它被牛奶弄湿了,现在它突然看起来一直被压着。

如何完全停用按钮以仅使用触摸板?

我有带 KDE 的 OpenSUSE 13.1。

slm*_*slm 10

大多数触摸板都可以使用命令行工具synclientxinput. 您可以在 ArchLinux wiki 中阅读有关这两种命令行工具的更多信息:

在这两个工具中,我不相信您可以使用synclient. 您可以使用xinput. 在这两种工具中,这是使用起来比较麻烦的一种,但并不太难。

如果您使用-hswitch运行它,您将获得以下使用信息:

$ xinput -h
usage :
    xinput get-feedbacks <device name>
    xinput set-ptr-feedback <device name> <threshold> <num> <denom>
    xinput set-integer-feedback <device name> <feedback id> <value>
    xinput get-button-map <device name>
    xinput set-button-map <device name> <map button 1> [<map button 2> [...]]
    xinput set-pointer <device name> [<x index> <y index>]
    xinput set-mode <device name> ABSOLUTE|RELATIVE
    xinput list [--short || --long || --name-only || --id-only] [<device name>...]
    xinput query-state <device name>
    xinput test [-proximity] <device name>
    xinput create-master <id> [<sendCore (dflt:1)>] [<enable (dflt:1)>]
    xinput remove-master <id> [Floating|AttachToMaster (dflt:Floating)] [<returnPointer>] [<returnKeyboard>]
    xinput reattach <id> <master>
    xinput float <id>
    xinput set-cp <window> <device>
    xinput test-xi2 <device>
    xinput map-to-output <device> <output name>
    xinput list-props <device> [<device> ...]
    xinput set-int-prop <device> <property> <format (8, 16, 32)> <val> [<val> ...]
    xinput set-float-prop <device> <property> <val> [<val> ...]
    xinput set-atom-prop <device> <property> <val> [<val> ...]
    xinput watch-props <device>
    xinput delete-prop <device> <property>
    xinput set-prop <device> [--type=atom|float|int] [--format=8|16|32] <property> <val> [<val> ...]
    xinput disable <device>
    xinput enable <device>
Run Code Online (Sandbox Code Playgroud)

我将从名称包含文本“按钮”的选项开始。

$ xinput -h 2>&1 | grep button
    xinput get-button-map <device name>
    xinput set-button-map <device name> <map button 1> [<map button 2> [...]]
Run Code Online (Sandbox Code Playgroud)

您需要设备的名称才能查询它。为此,您将使用xinput list.

例子

$ xinput list
? Virtual core pointer                      id=2    [master pointer  (3)]
?   ? Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
?   ? Logitech Unifying Device. Wireless PID:4013   id=9    [slave  pointer  (2)]
?   ? SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
?   ? TPPS/2 IBM TrackPoint                     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)]
    ? Sleep Button                              id=8    [slave  keyboard (3)]
    ? AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
    ? ThinkPad Extra Buttons                    id=13   [slave  keyboard (3)]
Run Code Online (Sandbox Code Playgroud)

该设备处理的通常是“SynPS/2 Synaptics TouchPad”,但可能因您的特定硬件而异。

$ xinput get-button-map "SynPS/2 Synaptics TouchPad"
1 2 3 4 5 6 7 8 9 10 11 12 
Run Code Online (Sandbox Code Playgroud)

这些是为我的 Thinkpad T410 笔记本电脑的触摸板指定的所有“按钮”。触摸板上的任何角落等也被视为“按钮”,这就是为什么上面的输出中有这么多。您可以使用--long开关找到更多关于上面列表中哪些按钮是哪个数字的信息。

例子

$ xinput list --long "SynPS/2 Synaptics TouchPad" 
...
?   ? SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
    Reporting 8 classes:
        Class originated from: 11. Type: XIButtonClass
        Buttons supported: 12
        Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" None None None None None
        Button state:
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 0:
          Label: Rel X
          Range: 1472.000000 - 5888.000000
          Resolution: 75000 units/m
          Mode: relative
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 1:
          Label: Rel Y
          Range: 1408.000000 - 4820.000000
          Resolution: 105000 units/m
          Mode: relative
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 2:
          Label: Rel Horiz Scroll
          Range: 0.000000 - -1.000000
          Resolution: 0 units/m
          Mode: relative
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 3:
          Label: Rel Vert Scroll
          Range: 0.000000 - -1.000000
          Resolution: 0 units/m
          Mode: relative
    ...
Run Code Online (Sandbox Code Playgroud)

好的,那很好,但是如何禁用按钮?

如果您查看手册页,xinput您会看到以下线索:

$ man xinput
...
   --set-button-map device map_button_1 [map_button_2 [...]]
        Change the button mapping of device. The buttons are specified 
        in physical order (starting with button 1) and  are  mapped  to
        the logical button provided. 0 disables a button. The default 
        button mapping for a device is 1 2 3 4 5 6 etc.
...
Run Code Online (Sandbox Code Playgroud)

因此,如果您记下要使用xinput list --long "SynPS/2 Synaptics TouchPad"禁用的按钮,则可以执行以下操作,如果您想禁用按钮 #5。

$ xinput set-button-map "SynPS/2 Synaptics TouchPad" 1 2 3 4 0 6 7 8 9 10 11 12
Run Code Online (Sandbox Code Playgroud)

注意:在上面的示例中,"SynPS/2 Synaptics TouchPad"也可以替换为11,因为这是此特定输入的 ID,因此与上面的相同:

$ xinput set-button-map 11 1 2 3 4 0 6 7 8 9 10 11 12
Run Code Online (Sandbox Code Playgroud)

设备名称提示

在输出中,xinput list您可能已经注意到带有字符串的列id=#

$ xinput list
? Virtual core pointer                      id=2    [master pointer  (3)]
?   ? Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
?   ? Logitech Unifying Device. Wireless PID:4013   id=9    [slave  pointer  (2)]
?   ? SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
?   ? TPPS/2 IBM TrackPoint                     id=12   [slave  pointer  (2)]
Run Code Online (Sandbox Code Playgroud)

可以使用这些 ID 代替烦人的长字符串:“SynPS/2 Synaptics TouchPad”。

$ xinput list-props 11
Run Code Online (Sandbox Code Playgroud)