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

733 lines
13 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Using the Phys descriptor and USB 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="Using XFree with event interface support"
HREF="tweak_input_devs-xev1.html"><LINK
REL="NEXT"
TITLE="Configuring display managers"
HREF="dm_conf.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-xev1.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="dm_conf.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-phys"
></A
>5.4. Using the <SPAN
CLASS="QUOTE"
>"Phys"</SPAN
> descriptor and USB devices</H1
><P
>Using the <SPAN
CLASS="QUOTE"
>"Phys"</SPAN
> descriptor of input devices simplifies a lot the configuration of input devices in XFree, especially when a bigger number of displays are used.</P
><P
>As USB devices are connecting in a tree form, you can really easy specify the way keyboard and mice devices are bound to a specified X display. You have to use one USB hub with number of ports equal(or bigger) to the number of the X displays, to this hub are connected smaller (2-4 port) hubs (or keyboards with integrated hub). To the first port of the smaller (integrated) hub are connected the keyboards, to the second the mice (in case there are free ports you can connect usb-audio devices to them :) ). This results in the following layout of the usb-id's in case the primary USB hub is the first USB device :</P
><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
>In the following explanations and examples I use for first device on the secondary(integrated) hub keyboard device because my keyboard is internally connected to the 1st port of the integrated hub. I assume this will apply for most of the keyboards with integrated hub, but in case the one you own uses different port you will have to make small adjustments.</P
></TD
></TR
></TABLE
></DIV
><P
></P
><UL
><LI
><P
>on the 1st port of the primary hub</P
><P
></P
><UL
><LI
><P
>1.1 USB hub (integrated)</P
></LI
><LI
><P
>1.1.1 USB keyboard</P
></LI
><LI
><P
>1.1.2 USB mouse</P
></LI
><LI
><P
>(1.1.3 usb-audio/other usb device)</P
></LI
></UL
></LI
><LI
><P
>on the 2nd port</P
><P
></P
><UL
><LI
><P
>1.2 USB hub (integrated)</P
></LI
><LI
><P
>1.2.1 USB keyboard</P
></LI
><LI
><P
>1.2.2 USB mouse</P
></LI
><LI
><P
>(1.2.3 usb-audio/other usb device)</P
></LI
></UL
></LI
><LI
><P
>on the 3rd port</P
><P
></P
><UL
><LI
><P
>1.3 USB hub (integrated)</P
></LI
><LI
><P
>1.3.1 USB keyboard</P
></LI
><LI
><P
>1.3.2 USB mouse</P
></LI
><LI
><P
>(1.3.3 usb-audio/other usb device)</P
></LI
></UL
></LI
><LI
><P
>on the 4th port</P
><P
></P
><UL
><LI
><P
>1.4 USB hub (integrated)</P
></LI
><LI
><P
>1.4.1 USB keyboard</P
></LI
><LI
><P
>1.4.2 USB mouse</P
></LI
><LI
><P
>(1.4.3 usb-audio/other usb device)</P
></LI
></UL
></LI
></UL
><P
>Based on this we can bind all devices connected to a specified USB port to a given X server.</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="tweak_input_devs-inputAgent2"
></A
>5.4.1. ... with Input Agent</H2
><P
>An example for a 4-user system using the <SPAN
CLASS="QUOTE"
>"Phys"</SPAN
> descriptor with Input Agent and USB input devices.</P
><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
>Here the PCI function of the USB controller is masked by *.* so it should work both under Backstreet Ruby and Ruby-2.6 . If you use more then one USB controller you'll have to use different mask ( for example "usb-0*:xx.x-...") or specify the full PHYS_ID's : .</P
><P
>For Backstreet Ruby you should have PHYS_ID "usb-00:xx.x-..."</P
><P
>For Ruby-2.6 you should have PHYS_ID "usb-0000:00:xx.x-...." </P
></TD
></TR
></TABLE
></DIV
><P
>We'll use the <SPAN
CLASS="QUOTE"
>"<B
CLASS="command"
>vt[n]</B
>"</SPAN
> parameter when starting X and the following configuration file for the keyboards(<TT
CLASS="filename"
>/etc/hotplug/kbd.conf</TT
> ):</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;#
# keyboard configuration
#
# vt_name device_physicaly_location
VT0 usb-*.*-1.1.1/input0
VT1 usb-*.*-1.2.1/input0
VT2 usb-*.*-1.3.1/input0
VT3 usb-*.*-1.4.1/input0
</PRE
></FONT
></TD
></TR
></TABLE
><P
>For mouse devices the configuration file (<TT
CLASS="filename"
>/etc/hotplug/mouse.conf</TT
>) will look like this:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;#
# mouse device configuration
#
# sym_link device_physicaly_location
mouse0br usb-*.*-1.1.2/input0
mouse1br usb-*.*-1.2.2/input0
mouse2br usb-*.*-1.3.2/input0
mouse3br usb-*.*-1.4.2/input0
</PRE
></FONT
></TD
></TR
></TABLE
><P
>and we have to adjust the XFree configuration files, so XFree uses the symbolic links instead of the actual devices. If you already configured independent mice you have only to append <SPAN
CLASS="QUOTE"
>"br"</SPAN
> to each of the mouse devices.</P
><P
>Change each <SPAN
CLASS="QUOTE"
>"/dev/input/mouse[n]"</SPAN
> to <SPAN
CLASS="QUOTE"
>"/dev/input/mouse[n]br"</SPAN
>.</P
><P
>For the first display:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;......
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0br"
Option "ZAxisMapping" "4 5"
# ChordMiddle is an option for some 3-button Logitech mice
Option "Emulate3Buttons"
# Option "ChordMiddle"
EndSection
......
</PRE
></FONT
></TD
></TR
></TABLE
><P
>For the second display:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;......
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1br"
Option "ZAxisMapping" "4 5"
# ChordMiddle is an option for some 3-button Logitech mice
Option "Emulate3Buttons"
# Option "ChordMiddle"
EndSection
......
</PRE
></FONT
></TD
></TR
></TABLE
><P
>and so on.</P
><P
>Or in case a single XFree configuration file is used:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;......
# **********************************************************************
# Pointer section
# **********************************************************************
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse0br"
Option "ZAxisMapping" "4 5"
# ChordMiddle is an option for some 3-button Logitech mice
Option "Emulate3Buttons"
# Option "ChordMiddle"
EndSection
Section "InputDevice"
Identifier "Mouse2"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1br"
Option "ZAxisMapping" "4 5"
# ChordMiddle is an option for some 3-button Logitech mice
Option "Emulate3Buttons"
# Option "ChordMiddle"
EndSection
......
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="tweak_input_devs-Xev2"
></A
>5.4.2. ... with XFree with event interface support</H2
><P
>Using the <SPAN
CLASS="QUOTE"
>"Dev Phys"</SPAN
> option of XFree with event device support and USB input devices enables us to use almost identical configuration of the input devices for all X servers. The only difference will be in the part of the usb-id, which reflects the port of the primary USB hub.</P
><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
>The examples below are for multiple XFree configuration files, if you use a single XFree configuration file you have to adjust the identifiers.</P
></TD
></TR
></TABLE
></DIV
><P
>The configuration for the input devices for the 1st display would look something like this:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-1.1.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-1.1.2/input0"
Option "ZAxisMapping" "4 5"
EndSection</PRE
></FONT
></TD
></TR
></TABLE
><P
>For the 2nd display something like this:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-1.2.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-1.2.2/input0"
Option "ZAxisMapping" "4 5"
EndSection</PRE
></FONT
></TD
></TR
></TABLE
><P
>For the 3rd display something like this:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-1.3.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-1.3.2/input0"
Option "ZAxisMapping" "4 5"
EndSection</PRE
></FONT
></TD
></TR
></TABLE
><P
>and so on.</P
><P
>You could also use the <SPAN
CLASS="QUOTE"
>"?"</SPAN
>, so wherever you plug the primary hub, all displays will still have the desired configuration.</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>&#13;Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-?.1.1/input0"
Option "AutoRepeat" "250 30"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc101"
Option "XkbLayout" "dvorak"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "evdev"
Option "Dev Phys" "usb-*-?.1.2/input0"
Option "ZAxisMapping" "4 5"
EndSection
</PRE
></FONT
></TD
></TR
></TABLE
></DIV
></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-xev1.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="dm_conf.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Using XFree with event interface support</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"
>Configuring display managers</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>