IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

HOWTOs

Search Howtos :Match :

5.1. Finding the real devices

We will need this information later on, to be able to assign a given keyboard/mouse to a given X-server/Display.

To find the PHYS ID's (the addresses) or the name(quite oft it differs from the one labeled on the device) of your input devices you have to read the file /proc/bus/input/devices.

Here is what I have:

[svetljo at svetljo How-To]# cat /proc/bus/input/devices 
I: Bus=0011 Vendor=0002 Product=0002 Version=0034
N: Name="PS2++ Logitech Wheel Mouse"
P: Phys=isa0060/serio1/input0
H: Handlers=mouse0 ts0 
B: EV=7 
B: KEY=f0000 0 0 0 0 0 0 0 0 
B: REL=103 

I: Bus=0011 Vendor=0001 Product=0002 Version=ab02
N: Name="AT Set 2 keyboard"
P: Phys=isa0060/serio0/input0
H: Handlers=kbd 
B: EV=120003 
B: KEY=4 2000000 8061f9 fbc9d621 efdfffdf ffefffff ffffffff fffffffe 
B: LED=7 

I: Bus=0003 Vendor=046d Product=c303 Version=0700
N: Name="Logitech    USB Keyboard"
P: Phys=usb-00:10.1-1.1/input0
H: Handlers=kbd 
B: EV=120003 
B: KEY=10000 7f ffe00000 7ff ffbeffdf ffffffff ffffffff fffffffe 
B: LED=7 

I: Bus=0003 Vendor=046d Product=c303 Version=0700
N: Name="Logitech    USB Keyboard"
P: Phys=usb-00:10.1-1.1/input1
H: Handlers=kbd 
B: EV=100003 
B: KEY=1078 1800d100 1e0000 0 0 0 

I: Bus=0003 Vendor=05fe Product=0011 Version=0000
N: Name="Cypress Sem. PS2/USB Browser Combo Mouse"
P: Phys=usb-00:10.1-1.2/input0
H: Handlers=mouse1 ts1 
B: EV=7 
B: KEY=1f0000 0 0 0 0 0 0 0 0 
B: REL=103 

NoteNote
 

  • /proc/bus/input/devices will provide the needed information for all devices except USB multimedia/office keyboards.

  • For such USB multimedia/office keyboards you will have to gather additional information, for example with the help of lsusb.

  • Under Ruby-2.6 for usb devices it will look like "usb-0000:00:10.x" not "usb-00:10.x"

  • First we have to find the address of the USB keyboard:

    [root at svetljo How-To]# lsusb
    Bus 004 Device 001: ID 0000:0000  
    Bus 003 Device 001: ID 0000:0000  
    Bus 003 Device 002: ID 0409:55ab NEC Corp. Hub [iMac kbd]
    Bus 003 Device 003: ID 046d:c303 Logitech, Inc. 
    Bus 003 Device 004: ID 05fe:0011 Chic Technology Corp. Browser Mouse
    Bus 002 Device 001: ID 0000:0000  
    Bus 001 Device 001: ID 0000:0000  

    Here, my USB Logitech keyboard is Device 003 on Bus 003.

  • Now we run lsusb with arguments -v -s [your USB keyboard device id in form Bus:Device], in my case, lsusb -v -s 003:003.

    ........
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         3 Human Interface Devices
          bInterfaceSubClass      1 Boot Interface Subclass
          bInterfaceProtocol      1 Keyboard
          iInterface              0 
    ........
    
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         3 Human Interface Devices
          bInterfaceSubClass      0 No Subclass
          bInterfaceProtocol      0 None
          iInterface              0 
    ........
    

So my USB keyboard has two interfaces (see bInterfaceNumber); the first one is the real keyboard (bInterfaceProtocol 1 Keyboard), the second (bInterfaceProtocol 0 None) - the additional keys. Hence the real USB keyboard is:

.....
N: Name="Logitech    USB Keyboard"
P: Phys=usb-00:10.1-1.1/input0
H: Handlers=kbd 
.....

The "P: Phys=" field (the physical descriptor/address) consorts of:

  1. Bus type: "usb"

  2. PCI function of the USB controller: "00:10.1 " ( for Ruby-2.6 "0000:00:10.1")

  3. USB device id: "1.1"

  4. The string: "/input"

  5. Interface number: "0"

Search Howtos :Match :
DbVisualizer 6.5.2
The Universal Database Tool
PhpMyAdmin 3.1.2 rc1
Php front-end to MySQL administration
Xine 1.1.6
Free video player
Glade 3.5.5
User interface builder for GTK+ and Gnome
Evolution 2.25.4
GNOME mailer, calendar, contact manager and communications tool
GEdit 2.25.4
Small but powerful text editor
LimeWire 5.0.4
Gnutella Client
WebGUI 7.6.8
A fully featured content management system.
GTK2 2.14.7
GUI Toolkit
Brasero 0.9.0
Application to burn CD/DVD
Free IT Magazines, White Papers, eBooks, and more !
Dr. Dobb's Journal

Dr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries.

The 7 Things that IT Security Professionals MUST KNOW!

Gain key insight into security problem and find the safest means to protect your technological assets.

Database Trends and Applications

Provides timely coverage of the technology, intelligence and insight needed to plan, implement and manage information-rich projects.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info