タッチパッドは維持しますが、ボタンを無効にしたい場合

タッチパッドは維持しますが、ボタンを無効にしたい場合

私たちの子供のacer v5の右ボタンが壊れています。牛乳に濡れていましたが、突然押されたように見えました。

タッチパッドのみを使用するにはボタンを完全に無効にするにはどうすればよいですか?

OpenSUSE 13.1とKDEがあります。

ベストアンサー1

ほとんどのタッチパッドはコマンドラインツールsynclientxinput

これら2つのツールのうち、無効なuttonsを使用できるとは思いませんsynclient。を使用してこれを行うことができますxinput。 2つのツールのうち、これは使用するのが面倒ですが、それほど難しくありません。

スイッチを使用して実行すると、-h次の使用情報が得られます。

$ 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>

名前に「Button」というテキストを含むオプションから始めましょう。

$ xinput -h 2>&1 | grep button
    xinput get-button-map <device name>
    xinput set-button-map <device name> <map button 1> [<map button 2> [...]]

クエリにはデバイス名が必要です。これを行うにはを使用します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)]

デバイスハンドルは通常「SynPS / 2 Synaptics TouchPad」ですが、特定のハードウェアによって異なる場合があります。

$ xinput get-button-map "SynPS/2 Synaptics TouchPad"
1 2 3 4 5 6 7 8 9 10 11 12 

これは私の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
    ...

いいですね。しかし、ボタンをどのように無効にしますか?

マニュアルページを見ると、次の手がかりを見ること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.
...

したがって、無効にしたいボタンを記録する場合は、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

メモ:上記の例では、"SynPS/2 Synaptics TouchPad"これを置き換えることもできます11。これは特定の入力のIDなので、上記と同じです。

$ xinput set-button-map 11 1 2 3 4 0 6 7 8 9 10 11 12

デバイス名のヒント

出力に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)]

面倒な長い文字列の代わりに「SynPS / 2 Synaptics TouchPad」というIDを使用できます。

$ xinput list-props 11

おすすめ記事