首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当USB鼠标连接时,我能自动关闭我的触控板吗?

当USB鼠标连接时,我能自动关闭我的触控板吗?
EN

Ask Ubuntu用户
提问于 2011-08-25 09:42:38
回答 2查看 18.3K关注 0票数 20

我知道我可以检查一下触摸屏是否激活了

代码语言:javascript
运行
复制
gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled 

我可以将它设置为禁用/启用

代码语言:javascript
运行
复制
gconftool-2 --set --type boolean /desktop/gnome/peripherals/touchpad/touchpad_enabled true

使用lsusb,我可以看到所有连接的USB设备.这是给我的老鼠的:

代码语言:javascript
运行
复制
Bus 003 Device 002: ID 046d:c00e Logitech, Inc. M-BJ58/M-BJ69 Optical Wheel Mouse

有关lsusb -v的更多信息:

代码语言:javascript
运行
复制
Bus 005 Device 002: ID 046d:c00e Logitech, Inc. M-BJ58/M-BJ69 Optical Wheel Mouse
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc00e M-BJ58/M-BJ69 Optical Wheel Mouse
  bcdDevice           11.10
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               98mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      52
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              10

以下是来自tail -n 10 -f /var/log/messages的信息:

代码语言:javascript
运行
复制
Aug 27 08:36:47 pc08 kernel: [ 1795.936583] usb 5-2: USB disconnect, address 3
Aug 27 08:36:55 pc08 kernel: [ 1804.208042] usb 5-2: new low speed USB device using uhci_hcd and address 4
Aug 27 08:36:56 pc08 kernel: [ 1804.384272] usb 5-2: configuration #1 chosen from 1 choice
Aug 27 08:36:56 pc08 kernel: [ 1804.400743] input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/input/input13
Aug 27 08:36:56 pc08 kernel: [ 1804.400923] generic-usb 0003:046D:C00E.0004: input,hidraw0: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:1d.0-2/input0

更多的信息:

代码语言:javascript
运行
复制
$ udevadm info --query=all --name=/dev/input/mouse1
P: /devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/input/input15/mouse1
N: input/mouse1
S: char/13:33
S: input/by-id/usb-Logitech_USB-PS_2_Optical_Mouse-mouse
S: input/by-path/pci-0000:00:1d.0-usb-0:2:1.0-mouse
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb5/5-2/5-2:1.0/input/input15/mouse1
E: MAJOR=13
E: MINOR=33
E: DEVNAME=/dev/input/mouse1
E: SUBSYSTEM=input
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_VENDOR=Logitech
E: ID_VENDOR_ENC=Logitech
E: ID_VENDOR_ID=046d
E: ID_MODEL=USB-PS_2_Optical_Mouse
E: ID_MODEL_ENC=USB-PS\x2f2\x20Optical\x20Mouse
E: ID_MODEL_ID=c00e
E: ID_REVISION=1110
E: ID_SERIAL=Logitech_USB-PS_2_Optical_Mouse
E: ID_TYPE=hid
E: ID_BUS=usb
E: ID_USB_INTERFACES=:030102:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_PATH=pci-0000:00:1d.0-usb-0:2:1.0
E: DEVLINKS=/dev/char/13:33 /dev/input/by-id/usb-Logitech_USB-PS_2_Optical_Mouse-mouse /dev/input/by-path/pci-0000:00:1d.0-usb-0:2:1.0-mouse

当USB-鼠标连接时,我如何使用它来自动关闭我的触摸屏,并在USB-鼠标消失时再次激活它?

EN

回答 2

Ask Ubuntu用户

发布于 2011-08-25 09:59:16

这个项目似乎不再被维护。

对于natty来说,有一个触摸屏指示器应用程序。当鼠标插入或拔出时,可以将其设置为禁用/启用触摸屏。我不知道它是否也适用于较老的Ubuntu版本。

https://launchpad.net/touchpad-indicator

代码语言:javascript
运行
复制
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install touchpad-indicator
票数 10
EN

Ask Ubuntu用户

发布于 2011-08-25 10:07:12

您可以设置udev规则来禁用/启用触摸屏。ArchLinux维基有以下规则用于从udev切换Synaptic触控板:

代码语言:javascript
运行
复制
ACTION=="add", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0", 
ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=1"

ACTION=="remove", SUBSYSTEM=="input", KERNEL=="mouse[1-9]", ENV{DISPLAY}=":0.0", 
ENV{XAUTHORITY}="/home/USERNAME/.Xauthority", ENV{ID_CLASS}="mouse", RUN+="/usr/bin/synclient TouchpadOff=0"
票数 6
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/58584

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档