old-www/HOWTO/XFree-Local-multi-user-HOWTO/tweak_input_devs-realdev.html

423 lines
7.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Finding the real devices</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="XFree Local Multi-User HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="More on configuring input devices"
HREF="tweak_input_devs.html"><LINK
REL="PREVIOUS"
TITLE="More on configuring input devices"
HREF="tweak_input_devs.html"><LINK
REL="NEXT"
TITLE="Using hotplug with input.agent and input.rc"
HREF="tweak_input_devs-inputagent1.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>XFree Local Multi-User HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="tweak_input_devs.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 5. More on configuring input devices</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="tweak_input_devs-inputagent1.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="tweak_input_devs-realDev"
></A
>5.1. Finding the real devices</H1
><P
>We will need this information later on, to be able to assign a given keyboard/mouse to a given X-server/Display.</P
><P
>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 <TT
CLASS="filename"
>/proc/bus/input/devices</TT
>.</P
><P
>Here is what I have:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>[svetljo@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 </PRE
></FONT
></TD
></TR
></TABLE
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>Note</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
></P
><UL
><LI
><P
><TT
CLASS="filename"
>/proc/bus/input/devices</TT
> will provide the needed information for all devices except USB multimedia/office keyboards.</P
></LI
><LI
><P
>For such USB multimedia/office keyboards you will have to gather additional information, for example with the help of <B
CLASS="command"
>lsusb</B
>.</P
></LI
><LI
><P
>Under Ruby-2.6 for usb devices it will look like "usb-0000:00:10.x" not "usb-00:10.x" <B
CLASS="command"
></B
></P
></LI
></UL
></TD
></TR
></TABLE
></DIV
><P
></P
><UL
><LI
><P
>First we have to find the address of the USB keyboard:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>[root@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 </PRE
></FONT
></TD
></TR
></TABLE
><P
>Here, my USB Logitech keyboard is Device 003 on Bus 003.</P
></LI
><LI
><P
>Now we run <B
CLASS="command"
> lsusb</B
> with arguments <TT
CLASS="parameter"
><I
> -v -s [your USB keyboard device id in form Bus:Device]</I
></TT
>, in my case, <B
CLASS="command"
>lsusb -v -s 003:003</B
>.</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>........
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
........
</PRE
></FONT
></TD
></TR
></TABLE
></LI
></UL
><P
>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:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>.....
N: Name="Logitech USB Keyboard"
P: Phys=usb-00:10.1-1.1/input0
H: Handlers=kbd
.....</PRE
></FONT
></TD
></TR
></TABLE
><P
>The <SPAN
CLASS="QUOTE"
>"P: Phys="</SPAN
> field (the physical descriptor/address) consorts of:</P
><P
></P
><OL
TYPE="1"
><LI
><P
>Bus type: <SPAN
CLASS="QUOTE"
>"usb"</SPAN
></P
></LI
><LI
><P
>PCI function of the USB controller: <SPAN
CLASS="QUOTE"
>"00:10.1 "</SPAN
> ( for Ruby-2.6 "0000:00:10.1")</P
></LI
><LI
><P
>USB device id: <SPAN
CLASS="QUOTE"
>"1.1"</SPAN
></P
></LI
><LI
><P
>The string: <SPAN
CLASS="QUOTE"
>"/input"</SPAN
></P
></LI
><LI
><P
>Interface number: <SPAN
CLASS="QUOTE"
>"0"</SPAN
></P
></LI
></OL
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="tweak_input_devs.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="tweak_input_devs-inputagent1.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>More on configuring input devices</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="tweak_input_devs.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Using hotplug with <TT
CLASS="filename"
>input.agent</TT
> and <TT
CLASS="filename"
>input.rc</TT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>