Eu tenho uma regra do udev para o meu teclado externo. Posso capturar eventos e, ao executar um script, também posso acessar as variáveis do udev env. Posso desativar o teclado com o udev? Ou devo usar um script para desativar o teclado de outra maneira.
Existe uma maneira de desativar o teclado com o script para executar xinput
, mas ele quer um "id". Como posso obter as informações de id para xinput
do udev? ou existe outro caminho efetivo?
Rastreio completo ao monitorar o udev para o teclado:
KERNEL[2563.037091] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2 (usb)
ACTION=add
BUSNUM=002
DEVICE=/proc/bus/usb/002/003
DEVNAME=bus/usb/002/003
DEVNUM=003
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2
DEVTYPE=usb_device
MAJOR=189
MINOR=130
PRODUCT=1c4f/2/110
SEQNUM=1538
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=3
KERNEL[2563.037837] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0 (usb)
ACTION=add
DEVICE=/proc/bus/usb/002/003
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0
DEVTYPE=usb_interface
INTERFACE=3/1/1
MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc01ip01
PRODUCT=1c4f/2/110
SEQNUM=1539
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=3
KERNEL[2563.038023] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005 (hid)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005
HID_ID=0003:00001C4F:00000002
HID_NAME=SIGMACH1P USB Keykoard
HID_PHYS=usb-0000:09:00.0-2/input0
MODALIAS=hid:b0003v00001C4Fp00000002
SEQNUM=1540
SUBSYSTEM=hid
UDEV_LOG=3
KERNEL[2563.040754] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17 (input)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17
EV=120013
KEY=1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe
LED=7
MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw
MSC=10
NAME="SIGMACH1P USB Keykoard"
PHYS="usb-0000:09:00.0-2/input0"
PRODUCT=3/1c4f/2/110
PROP=0
SEQNUM=1541
SUBSYSTEM=input
UDEV_LOG=3
UNIQ=""
KERNEL[2563.040970] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6 (input)
ACTION=add
DEVNAME=input/event6
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6
MAJOR=13
MINOR=70
SEQNUM=1542
SUBSYSTEM=input
UDEV_LOG=3
KERNEL[2563.041090] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2 (hidraw)
ACTION=add
DEVNAME=hidraw2
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2
MAJOR=252
MINOR=2
SEQNUM=1543
SUBSYSTEM=hidraw
UDEV_LOG=3
KERNEL[2563.041168] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1 (usb)
ACTION=add
DEVICE=/proc/bus/usb/002/003
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1
DEVTYPE=usb_interface
INTERFACE=3/0/0
MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc00ip00
PRODUCT=1c4f/2/110
SEQNUM=1544
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=3
KERNEL[2563.041309] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006 (hid)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006
HID_ID=0003:00001C4F:00000002
HID_NAME=SIGMACH1P USB Keykoard
HID_PHYS=usb-0000:09:00.0-2/input1
MODALIAS=hid:b0003v00001C4Fp00000002
SEQNUM=1545
SUBSYSTEM=hid
UDEV_LOG=3
KERNEL[2563.044144] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18 (input)
ABS=100000000
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18
EV=1f
KEY=4837fff072ff32d bf54444600000000 1 20c100b17c000 267bfad941dfed 9e168000004400 10000002
MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,2,3,4,k71,72,73,74,77,80,82,83,85,86,87,88,89,8A,8B,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B1,B2,B5,CE,CF,D0,D1,D2,D4,D8,D9,DB,E4,EA,EB,F1,100,161,162,166,16A,16E,172,174,176,178,179,17A,17B,17C,17D,17F,180,182,183,185,188,189,18C,18D,18E,18F,190,191,192,193,195,198,199,19A,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,1BA,r6,a20,m4,lsfw
MSC=10
NAME="SIGMACH1P USB Keykoard"
PHYS="usb-0000:09:00.0-2/input1"
PRODUCT=3/1c4f/2/110
PROP=0
REL=40
SEQNUM=1546
SUBSYSTEM=input
UDEV_LOG=3
UNIQ=""
KERNEL[2563.044365] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7 (input)
ACTION=add
DEVNAME=input/event7
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7
MAJOR=13
MINOR=71
SEQNUM=1547
SUBSYSTEM=input
UDEV_LOG=3
KERNEL[2563.044560] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3 (hidraw)
ACTION=add
DEVNAME=hidraw3
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3
MAJOR=252
MINOR=3
SEQNUM=1548
SUBSYSTEM=hidraw
UDEV_LOG=3
UDEV [2563.066401] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2 (usb)
ACTION=add
BUSNUM=002
DEVICE=/proc/bus/usb/002/003
DEVNAME=/dev/bus/usb/002/003
DEVNUM=003
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2
DEVTYPE=usb_device
ID_BUS=usb
ID_MODEL=USB_Keykoard
ID_MODEL_ENC=USB\x20Keykoard
ID_MODEL_ID=0002
ID_REVISION=0110
ID_SERIAL=SIGMACH1P_USB_Keykoard
ID_USB_INTERFACES=:030101:030000:
ID_VENDOR=SIGMACH1P
ID_VENDOR_ENC=SIGMACH1P
ID_VENDOR_ID=1c4f
MAJOR=189
MINOR=130
PRODUCT=1c4f/2/110
SEQNUM=1538
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=3
USEC_INITIALIZED=2563048257
UDEV [2563.071837] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1 (usb)
ACTION=add
DEVICE=/proc/bus/usb/002/003
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1
DEVTYPE=usb_interface
INTERFACE=3/0/0
MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc00ip00
PRODUCT=1c4f/2/110
SEQNUM=1544
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=3
USEC_INITIALIZED=2563068334
UDEV [2563.072377] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0 (usb)
ACTION=add
DEVICE=/proc/bus/usb/002/003
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0
DEVTYPE=usb_interface
INTERFACE=3/1/1
MODALIAS=usb:v1C4Fp0002d0110dc00dsc00dp00ic03isc01ip01
PRODUCT=1c4f/2/110
SEQNUM=1539
SUBSYSTEM=usb
TYPE=0/0/0
UDEV_LOG=3
USEC_INITIALIZED=2563068933
UDEV [2563.079363] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005 (hid)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005
HID_ID=0003:00001C4F:00000002
HID_NAME=SIGMACH1P USB Keykoard
HID_PHYS=usb-0000:09:00.0-2/input0
MODALIAS=hid:b0003v00001C4Fp00000002
SEQNUM=1540
SUBSYSTEM=hid
UDEV_LOG=3
USEC_INITIALIZED=2563074770
UDEV [2563.080760] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2 (hidraw)
ACTION=add
DEVNAME=/dev/hidraw2
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/0003:1C4F:0002.0005/hidraw/hidraw2
MAJOR=252
MINOR=2
SEQNUM=1543
SUBSYSTEM=hidraw
UDEV_LOG=3
USEC_INITIALIZED=2563080427
UDEV [2563.084307] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006 (hid)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006
HID_ID=0003:00001C4F:00000002
HID_NAME=SIGMACH1P USB Keykoard
HID_PHYS=usb-0000:09:00.0-2/input1
MODALIAS=hid:b0003v00001C4Fp00000002
SEQNUM=1545
SUBSYSTEM=hid
UDEV_LOG=3
USEC_INITIALIZED=2563073436
UDEV [2563.085738] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3 (hidraw)
ACTION=add
DEVNAME=/dev/hidraw3
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/0003:1C4F:0002.0006/hidraw/hidraw3
MAJOR=252
MINOR=3
SEQNUM=1548
SUBSYSTEM=hidraw
UDEV_LOG=3
USEC_INITIALIZED=2563085486
UDEV [2563.238882] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18 (input)
ABS=100000000
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18
EV=1f
ID_BUS=usb
ID_INPUT=1
ID_INPUT_KEY=1
ID_MODEL=USB_Keykoard
ID_MODEL_ENC=USB\x20Keykoard
ID_MODEL_ID=0002
ID_PATH=pci-0000:09:00.0-usb-0:2:1.1
ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_1
ID_REVISION=0110
ID_SERIAL=SIGMACH1P_USB_Keykoard
ID_TYPE=hid
ID_USB_DRIVER=usbhid
ID_USB_INTERFACES=:030101:030000:
ID_USB_INTERFACE_NUM=01
ID_VENDOR=SIGMACH1P
ID_VENDOR_ENC=SIGMACH1P
ID_VENDOR_ID=1c4f
KEY=4837fff072ff32d bf54444600000000 1 20c100b17c000 267bfad941dfed 9e168000004400 10000002
MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,2,3,4,k71,72,73,74,77,80,82,83,85,86,87,88,89,8A,8B,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B1,B2,B5,CE,CF,D0,D1,D2,D4,D8,D9,DB,E4,EA,EB,F1,100,161,162,166,16A,16E,172,174,176,178,179,17A,17B,17C,17D,17F,180,182,183,185,188,189,18C,18D,18E,18F,190,191,192,193,195,198,199,19A,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,1BA,r6,a20,m4,lsfw
MSC=10
NAME="SIGMACH1P USB Keykoard"
PHYS="usb-0000:09:00.0-2/input1"
PRODUCT=3/1c4f/2/110
PROP=0
REL=40
SEQNUM=1546
SUBSYSTEM=input
UDEV_LOG=3
UNIQ=""
USEC_INITIALIZED=2563044149
UDEV [2563.391000] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17 (input)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17
EV=120013
ID_BUS=usb
ID_INPUT=1
ID_INPUT_KEY=1
ID_INPUT_KEYBOARD=1
ID_MODEL=USB_Keykoard
ID_MODEL_ENC=USB\x20Keykoard
ID_MODEL_ID=0002
ID_PATH=pci-0000:09:00.0-usb-0:2:1.0
ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_0
ID_REVISION=0110
ID_SERIAL=SIGMACH1P_USB_Keykoard
ID_TYPE=hid
ID_USB_DRIVER=usbhid
ID_USB_INTERFACES=:030101:030000:
ID_USB_INTERFACE_NUM=00
ID_VENDOR=SIGMACH1P
ID_VENDOR_ENC=SIGMACH1P
ID_VENDOR_ID=1c4f
KEY=1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe
LED=7
MODALIAS=input:b0003v1C4Fp0002e0110-e0,1,4,11,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88,89,8A,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,F0,ram4,l0,1,2,sfw
MSC=10
NAME="SIGMACH1P USB Keykoard"
PHYS="usb-0000:09:00.0-2/input0"
PRODUCT=3/1c4f/2/110
PROP=0
SEQNUM=1541
SUBSYSTEM=input
UDEV_LOG=3
UNIQ=""
USEC_INITIALIZED=2563040766
UDEV [2563.410790] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7 (input)
ACTION=add
BACKSPACE=guess
DEVLINKS=/dev/input/by-id/usb-SIGMACH1P_USB_Keykoard-event-if01 /dev/input/by-path/pci-0000:09:00.0-usb-0:2:1.1-event
DEVNAME=/dev/input/event7
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.1/input/input18/event7
ID_BUS=usb
ID_INPUT=1
ID_INPUT_KEY=1
ID_MODEL=USB_Keykoard
ID_MODEL_ENC=USB\x20Keykoard
ID_MODEL_ID=0002
ID_PATH=pci-0000:09:00.0-usb-0:2:1.1
ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_1
ID_REVISION=0110
ID_SERIAL=SIGMACH1P_USB_Keykoard
ID_TYPE=hid
ID_USB_DRIVER=usbhid
ID_USB_INTERFACES=:030101:030000:
ID_USB_INTERFACE_NUM=01
ID_VENDOR=SIGMACH1P
ID_VENDOR_ENC=SIGMACH1P
ID_VENDOR_ID=1c4f
MAJOR=13
MINOR=71
SEQNUM=1547
SUBSYSTEM=input
UDEV_LOG=3
USEC_INITIALIZED=2563239989
XKBLAYOUT=tr
XKBMODEL=pc105
XKBOPTIONS=lv3:ralt_switch
UDEV [2563.576817] add /devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6 (input)
ACTION=add
BACKSPACE=guess
DEVLINKS=/dev/input/by-id/usb-SIGMACH1P_USB_Keykoard-event-kbd /dev/input/by-path/pci-0000:09:00.0-usb-0:2:1.0-event-kbd
DEVNAME=/dev/input/event6
DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:09:00.0/usb2/2-2/2-2:1.0/input/input17/event6
ID_BUS=usb
ID_INPUT=1
ID_INPUT_KEY=1
ID_INPUT_KEYBOARD=1
ID_MODEL=USB_Keykoard
ID_MODEL_ENC=USB\x20Keykoard
ID_MODEL_ID=0002
ID_PATH=pci-0000:09:00.0-usb-0:2:1.0
ID_PATH_TAG=pci-0000_09_00_0-usb-0_2_1_0
ID_REVISION=0110
ID_SERIAL=SIGMACH1P_USB_Keykoard
ID_TYPE=hid
ID_USB_DRIVER=usbhid
ID_USB_INTERFACES=:030101:030000:
ID_USB_INTERFACE_NUM=00
ID_VENDOR=SIGMACH1P
ID_VENDOR_ENC=SIGMACH1P
ID_VENDOR_ID=1c4f
MAJOR=13
MINOR=70
SEQNUM=1542
SUBSYSTEM=input
UDEV_LOG=3
USEC_INITIALIZED=2563392826
XKBLAYOUT=tr
XKBMODEL=pc105
XKBOPTIONS=lv3:ralt_switch
EDITAR PELO SHW POST
Informações do sistema
ID do Distribuidor: Debian
Descrição: Debian GNU / Linux 7.2 (wheezy)
Lançamento: 7,2
Codename: wheezy
udev versão 175
Desfaz o resultado do syslog do teclado
Jan 16 13:47:50 acpid: input device has been disconnected, fd 13
Jan 16 13:47:51 kernel: [ 694.216123] usb 1-1.3: USB disconnect, device number 17
Jan 16 13:47:51 acpid: input device has been disconnected, fd 15
Jan 16 13:47:51 kernel: [ 694.507848] usb 1-1.3: new low-speed USB device number 18 using ehci_hcd
Jan 16 13:47:51 kernel: [ 694.606225] usb 1-1.3: New USB device found, idVendor=1c4f, idProduct=0002
Jan 16 13:47:51 kernel: [ 694.606235] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jan 16 13:47:51 kernel: [ 694.606242] usb 1-1.3: Product: USB Keykoard
Jan 16 13:47:51 kernel: [ 694.606246] usb 1-1.3: Manufacturer: SIGMACH1P
Jan 16 13:47:51 kernel: [ 694.609792] input: SIGMACH1P USB Keykoard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input57
Jan 16 13:47:51 kernel: [ 694.610190] generic-usb 0003:1C4F:0002.0027: input,hidraw2: USB HID v1.10 Keyboard [SIGMACH1P USB Keykoard] on usb-0000:00:1a.0-1.3/input0
Jan 16 13:47:51 kernel: [ 694.613248] input: SIGMACH1P USB Keykoard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.1/input/input58
Jan 16 13:47:51 kernel: [ 694.613646] generic-usb 0003:1C4F:0002.0028: input,hidraw3: USB HID v1.10 Device [SIGMACH1P USB Keykoard] on usb-0000:00:1a.0-1.3/input1
Jan 16 13:47:51 mtp-probe: checking bus 1, device 18: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3"
Jan 16 13:47:51 mtp-probe: bus: 1, device: 18 was not an MTP device