553 lines
8.8 KiB
HTML
553 lines
8.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Using hotplug with input.agent and input.rc</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="Finding the real devices"
|
|
HREF="tweak_input_devs-realdev.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Using XFree with event interface support"
|
|
HREF="tweak_input_devs-xev1.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-realdev.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-xev1.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-inputAgent1"
|
|
></A
|
|
>5.2. Using hotplug with <TT
|
|
CLASS="filename"
|
|
>input.agent</TT
|
|
> and <TT
|
|
CLASS="filename"
|
|
>input.rc</TT
|
|
></H1
|
|
><P
|
|
>Using the input.agent will allow you to manage input devices based on their PHYS ID. </P
|
|
><P
|
|
>The input.rc script will run the input.agent with appropriate arguments for drivers that are built in the kernel or are loaded before hotplug is available. </P
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="AEN853"
|
|
></A
|
|
>5.2.1. <TT
|
|
CLASS="filename"
|
|
>input.agent</TT
|
|
></H2
|
|
><P
|
|
>The input agent uses 3 configuration files:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
><TT
|
|
CLASS="filename"
|
|
>/etc/hotplug/kbd.conf</TT
|
|
></P
|
|
></LI
|
|
><LI
|
|
><P
|
|
><TT
|
|
CLASS="filename"
|
|
>/etc/hotplug/mouse.conf</TT
|
|
></P
|
|
></LI
|
|
><LI
|
|
><P
|
|
><TT
|
|
CLASS="filename"
|
|
>/etc/hotplug/event.conf</TT
|
|
></P
|
|
></LI
|
|
></UL
|
|
>
|
|
</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
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
>The explanations here are using Backstreet Ruby ( usb devices have PHYS_ID "usb-00:xx.x-..."), if you are running Ruby-2.6 for usb devices you should have PHYS_ID "usb-0000:00:xx.x-...." , but you should be able to use the same configuration files both under Backstreet Ruby and Ruby-2.6 by specifying "usb-0*:xx.x-..." .</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><P
|
|
>To configure the keyboards you have to adjust <TT
|
|
CLASS="filename"
|
|
>/etc/hotplug/kbd.conf</TT
|
|
></P
|
|
><P
|
|
>If I wanted to use the PS2 keyboard for the primary Display and for the VGA console, I would have:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> #
|
|
# keyboard configuration
|
|
#
|
|
# vt_name device_physicaly_location
|
|
|
|
VT0 isa0060/serio0/input0
|
|
VT1 usb-00:10.1-1.1/input0
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Or, if I want to use the USB keyboard for the primary Display and for the VGA console: </P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> #
|
|
# keyboard configuration
|
|
#
|
|
# vt_name device_physicaly_location
|
|
|
|
VT0 usb-00:10.1-1.1/input0
|
|
VT1 isa0060/serio0/input0
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>you could also use <SPAN
|
|
CLASS="QUOTE"
|
|
>"*.*"</SPAN
|
|
> instead of the pci function of the USB controller:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> #
|
|
# keyboard configuration
|
|
#
|
|
# vt_name device_physicaly_location
|
|
|
|
VT0 usb-*.*-1.1/input0
|
|
VT1 isa0060/serio0/input0
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>For mouse devices you have to edit <TT
|
|
CLASS="filename"
|
|
>/etc/hotplug/mouse.conf</TT
|
|
></P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> #
|
|
# mouse device configuration
|
|
#
|
|
# sym_link device_physicaly_location
|
|
mouse0br usb-00:10.1-1.2/input0
|
|
mouse1br usb-*.*-2.7.*/input0
|
|
mouse2br isa0060/serio1/*
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>and adjust the XFree configuration file.</P
|
|
><P
|
|
>For the first mouse change</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> ......
|
|
Option "Protocol" "IMPS/2"
|
|
Option "Device" "/dev/input/mouse0"
|
|
Option "ZAxisMapping" "4 5"
|
|
......
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>to :</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> ......
|
|
Option "Protocol" "IMPS/2"
|
|
Option "Device" "/dev/input/mouse0br"
|
|
Option "ZAxisMapping" "4 5"
|
|
......
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>For the second mouse change</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> ......
|
|
Option "Protocol" "IMPS/2"
|
|
Option "Device" "/dev/input/mouse1"
|
|
Option "ZAxisMapping" "4 5"
|
|
......
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>to :</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> ......
|
|
Option "Protocol" "IMPS/2"
|
|
Option "Device" "/dev/input/mouse1br"
|
|
Option "ZAxisMapping" "4 5"
|
|
......
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> and so on.</P
|
|
><P
|
|
>For Event devices edit <TT
|
|
CLASS="filename"
|
|
>/etc/hotplug/event.conf</TT
|
|
></P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> #
|
|
# input event device config file
|
|
#
|
|
# symbolic_link device_physicaly_location
|
|
event0br isa0060/serio0/*
|
|
event1br isa0060/serio1/input0
|
|
event2br usb-*.*-3/input0
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>and configure the applications which use them to use the symbolic links instead of the real devices</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="AEN896"
|
|
></A
|
|
>5.2.2. <TT
|
|
CLASS="filename"
|
|
>input.rc</TT
|
|
></H2
|
|
><P
|
|
>If you are using input drivers built into the kernel please ensure that the <TT
|
|
CLASS="filename"
|
|
>input.rc</TT
|
|
> script is started/executed at system start. In case the script is not executed you will find that hotplug could not configure these 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
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
>This area requires user feedback. Currently I have information only about Mandrake, where hotplug is not run as service.</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><P
|
|
>If your distribution runs hotplug as service this will be done automatically.</P
|
|
><P
|
|
>If your distribution does not run hotplug as service you will have to modify your init scripts to run <TT
|
|
CLASS="filename"
|
|
>input.rc</TT
|
|
> for you before XFree is started. </P
|
|
><P
|
|
>You may add this at the end of your <TT
|
|
CLASS="filename"
|
|
>/etc/rc.d/rc.sysinit</TT
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
>if [[ -f /proc/bus/console -o -n tmp=`uname -r | sed -n 's:ruby::p'` ]]; then
|
|
if [ -x /etc/hotplug/input.rc ]; then
|
|
/etc/hotplug/input.rc start
|
|
if [ $? = 0 ]; then
|
|
action "Configuring cold plugged input devices" /bin/true
|
|
else
|
|
action "Configuring cold plugged input devices" /bin/false
|
|
fi
|
|
else if [ -f /etc/hotplug/input.rc ]; then
|
|
action "Input: input.rc installed, but not executable. Please check the file permissions." /bin/false
|
|
else
|
|
action "Input: Failed to configure cold plugged devices - input.rc missing" /bin/false
|
|
fi
|
|
fi
|
|
fi</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
> </P
|
|
></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-realdev.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-xev1.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Finding the real 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 XFree with event interface support</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |