1 Востаннє редагувалося ADR (08.02.2013 23:04:14)

Тема: [Скрипт] Xinput, або робота з текстом

Як можна у xinput призначити "карту кнопок" через назву пристрою (так як ІД міняється)?
Або як підставити ІД (через grep вирізаю рядок,а далі..)?

пробую так: (приставку "pointer:" мені підказали в команді list. (у мене клава і миша разом))

adr@ADR-Notebook:~$ xinput set-button-map 'MLK Trust Deskset 15176' 1 2 3 8 9 6 7 5 4
Warning: There are multiple devices named 'MLK Trust Deskset 15176'.
To ensure the correct one is selected, please use the device ID instead.

unable to find device 'MLK Trust Deskset 15176'
adr@ADR-Notebook:~$ xinput set-button-map 'pointer:MLK Trust Deskset 15176' 1 2 3 8 9 6 7 5 4
unable to find device 'pointer:MLK Trust Deskset 15176'

хоча list працює:

adr@ADR-Notebook:~$ xinput list 'MLK Trust Deskset 15176'
Warning: There are multiple devices matching 'MLK Trust Deskset 15176'.
To ensure the correct one is selected, please use the device ID, or prefix the
device name with 'pointer:' or 'keyboard:' as appropriate.

unable to find device MLK Trust Deskset 15176
adr@ADR-Notebook:~$ xinput list 'pointer:MLK Trust Deskset 15176'
MLK Trust Deskset 15176                     id=12    [slave  pointer  (2)]
    Reporting 10 classes:
        Class originated from: 12. Type: XIButtonClass
        Buttons supported: 13
        Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" "Button Side" "Button Extra" "Button Unknown" "Button Unknown" "Button Unknown" "Button Unknown"
        Button state:
        Class originated from: 12. Type: XIKeyClass
        Keycodes supported: 248
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 0:
          Label: Rel X
          Range: -1.000000 - -1.000000
          Resolution: 1 units/m
          Mode: relative
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 1:
          Label: Rel Y
          Range: -1.000000 - -1.000000
          Resolution: 1 units/m
          Mode: relative
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 2:
          Label: Rel Horiz Wheel
          Range: -1.000000 - -1.000000
          Resolution: 1 units/m
          Mode: relative
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 3:
          Label: Rel Dial
          Range: -1.000000 - -1.000000
          Resolution: 1 units/m
          Mode: relative
        Class originated from: 12. Type: XIValuatorClass
        Detail for Valuator 4:
          Label: Rel Vert Wheel
          Range: -1.000000 - -1.000000
          Resolution: 1 units/m
          Mode: relative
        Class originated from: 12. Type: XIScrollClass
        Scroll info for Valuator 2
          type: 2 (horizontal)
          increment: 1.000000
          flags: 0x0
        Class originated from: 12. Type: XIScrollClass
        Scroll info for Valuator 3
          type: 1 (vertical)
          increment: -1.000000
          flags: 0x0
        Class originated from: 12. Type: XIScrollClass
        Scroll info for Valuator 4
          type: 1 (vertical)
          increment: -1.000000
          flags: 0x2 ( preferred )

2 Востаннє редагувалося ADR (15.02.2013 20:00:54)

Re: [Скрипт] Xinput, або робота з текстом

розібрався:

xinput set-button-map $(xinput list --id-only 'pointer:MLK Trust Deskset 15176') 1 2 3 8 9 6 7 5 4