LDP/LDP/howto/docbook/XFree86-Second-Mouse.sgml

239 lines
8.7 KiB
Plaintext
Raw Normal View History

2001-07-20 18:54:24 +00:00
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
<article>
<artheader>
<title>Second Mouse in X mini-HOWTO</title>
<author>
<firstname>Greg</firstname>
<surname>Wierzchowski</surname>
<affiliation>
<address><email>greg.wierzchowski@usa.net</email></address>
</affiliation>
</author>
<pubdate>2001-07-18</pubdate>
<abstract>
<para>Quick instructions to enable a second mouse in X.</para>
</abstract>
<revhistory>
2001-11-18 17:02:04 +00:00
<revision>
<revnumber>1.2</revnumber>
<date>2001-11-17</date>
<authorinitials>GW</authorinitials>
<revremark>Corrected for the Wheel Mouse in XFree 3.x.</revremark>
</revision>
2001-07-21 14:25:01 +00:00
<revision>
<revnumber>1.1</revnumber>
<date>2001-07-21</date>
<authorinitials>GW</authorinitials>
<revremark>Added "Alternatives" section.</revremark>
</revision>
2001-07-20 18:54:24 +00:00
<revision>
<revnumber>1.0</revnumber>
<date>2001-07-18</date>
<authorinitials>GW</authorinitials>
<revremark>Initial Release.</revremark>
</revision>
</revhistory>
<keywordset>
<keyword>
XFree
</keyword>
<keyword>
mouse
</keyword>
</keywordset>
</artheader>
<section id="intro"><title>Introduction</title>
<para>
This mini-HOWTO was created by gathering the information already available on
the internet, in newsgroups and other HOWTOs. I needed to hook up an USB mouse
in addition to the built-in trackpoint on my Thinkpad laptop.
</para>
<para>
Examples in this mini-HOWTO pertain to my particular hardware configuration,
which is PS/2 mouse as a primary pointer and USB wheel mouse as an additional
one. It should be pretty straightforward to implement another combination, say,
a PS/2 and a serial mice. Two things that would have to be changed are the
<emphasis>mouse
protocol</emphasis> and the <emphasis>mouse device</emphasis>. Wherever
possible, I try to provide appropriate examle.
</para>
<para>
The instructions for X are divided into two sections, one for XFree version 3 and one
2001-07-20 18:54:24 +00:00
for XFree 4. The format of the XF86Config file has significantly changed between
versions and requires slightly different approach. In XFree 3.x, the second
mouse has to appear in an <emphasis>Xinput</emphasis> section, which has
slightly different syntax than the regular <emphasis>Pointer</emphasis> section.
In XFree 4.x, it's just another pointer.
</para>
</section>
<section id="copyright"><title>Copyright and License</title>
<para>This document is copyright 2001 by Greg Wierzchowski and is released under
the terms of the GNU Free Documentation License, which is hereby incorporated
by reference. Send feedback to
<ulink url="mailto:greg.wierzchowski@usa.net"><citetitle>greg.wierzchowski@usa.net</citetitle></ulink>.
</para>
</section>
<section id="protocol"><title>Mouse Protocols</title>
<para>Two most important parameters in the <filename>XF86Config</filename> file, ones that are crucial to the mouse working properly are the <emphasis>Protocol</emphasis> and <emphasis>Device</emphasis>.
</para>
<para>
As far as <emphasis>Protocol</emphasis> is concerned, it seems that
<emphasis>gpm</emphasis> uses compatible protocol names, so please look there
for the detailed information. Here is the excerpt taken from the gpm info page
(just the few most commont types):
<table frame="all">
<title>Most Common Mouse Protocols in X</title>
<tgroup cols="2">
<colspec colname="column1">
<colspec colname="column2">
<thead>
<row>
<entry>Protocol Name</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>Microsoft</entry>
<entry>Standard Microsoft mice.</entry>
</row>
<row>
<entry>MouseSystems</entry>
<entry>This is the standard protocol for three-button serial devices.</entry>
</row>
<row>
<entry>MMSeries</entry>
<entry>Title says it all. This mouse decoder accepts standard serial
options, although they should not be needed.</entry>
</row>
<row>
<entry>Logitech</entry>
<entry>This is the protocol used by old serial Logitech mice.</entry>
</row>
<row>
<entry>BusMouse</entry>
<entry>Some bus devices use this protocol, including those produced by
Logitech.</entry>
</row>
<row>
<entry>PS/2</entry>
<entry>The protocol used by most busmice.</entry>
</row>
<row>
<entry>IMPS/2</entry>
<entry>"IntelliMouse" on the ps/2 port. <emphasis>Also works with USB
mice</emphasis></entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</section>
<section id="xfree3"><title>XFree 3.x</title>
<para>
In XFree 3.x, additional pointing devices, like mice or tablets, are defined
through the use of an <emphasis>Xinput</emphasis> section. The primary mouse is
defined as usual:
<programlisting>
Section "Pointer"
Protocol "PS/2"
Device "/dev/mouse"
EndSection
</programlisting>
In the case above, it's a regular three-button PS/2 mouse, which works for the
trackpoint as well. Now, for the USB mouse:
<programlisting>
Section "Xinput"
SubSection "Mouse"
DeviceName "USB Mice"
Protocol "IMPS/2"
2001-11-18 17:02:04 +00:00
ZAxisMapping 4 5
2001-07-20 18:54:24 +00:00
Port "/dev/input/mice"
Alwayscore
EndSubSection
EndSection
</programlisting>
2001-11-18 17:02:04 +00:00
My mouse is a wheel mouse, thus the protocol is <emphasis>IMPS/2</emphasis>. ZAxisMapping line is also needed for the wheel to work.
I also want the mouse to always work alongside the other one, and this is achieved
2001-07-20 18:54:24 +00:00
through the <emphasis>AlwaysCore</emphasis> option. If. for example, this was
a serial mouse, the <emphasis>Port</emphasis> would read
<command>"/dev/ttyS0"</command> for <command>COM1</command>.
</para>
</section>
<section id="xfree4"><title>XFree 4.x</title>
<para>
With XFree 4.x the task is even easier. First, the primary mouse, usually present in the config file already:
<programlisting>
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Device" "/dev/mouse"
Option "Protocol" "PS/2"
Option "Emulate3Buttons" "off"
Option "ZAxisMapping" "4 5"
EndSection
</programlisting>
To add another mouse just copy the above section and modify it, so that it reads:
<programlisting>
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Device" "/dev/input/mice"
Option "Protocol" "IMPS/2"
Option "Emulate3Buttons" "off"
Option "ZAxisMapping" "4 5"
EndSection
</programlisting>
Well, this way you can define as many additional pointers as you wish, and the same applies to joysticks and tablets.
</para>
<para>
To make both mice work together, there's one more change to be made to the <filename>XF86Config</filename> file.
There is a section called <emphasis>ServerLayout</emphasis> where all the components are specified. Here's how it looks <emphasis>before</emphasis> adding a second mouse:
<programlisting>
Section "ServerLayout"
Identifier "XFree86 Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
</programlisting>
And <emphasis>after</emphasis> adding the second mouse:
<programlisting>
Section "ServerLayout"
Identifier "XFree86 Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Mouse1" "AlwaysCore"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
</programlisting>
</para>
</section>
2001-07-21 14:25:01 +00:00
<section id="alternatives"><title>Alternatives</title>
<para>
Another way to use two (or more) mice at the same time is to use a program such as <emphasis>MultiMouse</emphasis> by Takashi Manabe. It's a daemon multiplexing several mice and making them available through the special device <filename>/dev/mumse</filename> as a MouseSystems compatible mouse.
2001-07-21 14:25:01 +00:00
</para><para> According to the author: <quote>This program allows you to use multiple mice at the same time. This program is developed for a subnote user who want to use both a pre-mounted pointing device and a external serial mouse.</quote></para><para>I'm not sure if the program supports second mouse other than serial, but the advantage is that the second mouse works in console mode too. <command>MultiMouse</command> can be found at Sunsite (sunsite.unc.edu /pub/Linux/system/Misc) and Tucows (www.tucows.com Linux Console -> Utilities).
</para>
</section>
2001-07-20 18:54:24 +00:00
<section id="credits"><title>Credits</title>
<para>
Special thanks to all the people who contribute to the Linux community and who made this HOWTO possible.
</para>
</section>
</article>