old-www/HOWTO/3-Button-Mouse-8.html

86 lines
3.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>The 3 Button Serial Mouse mini-HOWTO: Using gpm to Switch Mouse Modes </TITLE>
<LINK HREF="3-Button-Mouse-9.html" REL=next>
<LINK HREF="3-Button-Mouse-7.html" REL=previous>
<LINK HREF="3-Button-Mouse.html#toc8" REL=contents>
</HEAD>
<BODY>
<A HREF="3-Button-Mouse-9.html">Next</A>
<A HREF="3-Button-Mouse-7.html">Previous</A>
<A HREF="3-Button-Mouse.html#toc8">Contents</A>
<HR>
<H2><A NAME="gpm"></A> <A NAME="s8">8. Using gpm to Switch Mouse Modes </A></H2>
<P><CODE>gpm</CODE> is the program that lets you use the mouse in console mode. It is
usually included in linux distributions, and can be started from the
command line or in the startup script <CODE>/etc/rc.d/rc.local</CODE>.
Note that distributions don't always have the most recent version
(1.13 at time of writing) which can be found on mirrors of sunsite.unc.edu.
<P>
<P>The main modes for serial mice under gpm are:
<BLOCKQUOTE><CODE>
<PRE>
gpm -t ms
gpm -t msc
gpm -t help
</PRE>
</CODE></BLOCKQUOTE>
<P>for Microsoft or MouseSystems modes, or to
probe the mouse for you and tell you what it found. To run gpm in
MouseSystems mode, you may need a <CODE>-3</CODE> flag, and possibly a
DTR option, using the <CODE>-o dtr</CODE> flag:
<P>
<BLOCKQUOTE><CODE>
gpm -3 -o dtr -t msc
</CODE></BLOCKQUOTE>
<P><CODE>gpm</CODE> is often able to recognise all three buttons of the mouse
even in Microsoft mode. And newer versions (Version 1.0 and later (?))
can then make this information available to other programs. For this to
work, you need to run gpm with the -R tag, like this:
<BLOCKQUOTE><CODE>
gpm -R -t ms
</CODE></BLOCKQUOTE>
This will make gpm re-export the mouse data to a new device, called
<CODE>/dev/gpmdata</CODE>, which looks like a mouse to any other program.
Note that this device <B>always</B> uses the MouseSystems protocol.
You can then set your Xconfig to use this instead of <CODE>/dev/mouse</CODE>
as shown below, but of course you must ensure gpm is always running when
you use X. Some people have reported that some middle-button events
are not correctly interpreted by X using this technique, this may be
down to an individual mouse setup.
<P>
<P>
<P><B>Changing button mapping for gpm and X</B>
(
<A HREF="mailto:gustafso&commat;math.utah.edu">gustafso&commat;math.utah.edu</A>)
<P>
<P>
<P>You may find that gpm uses different default button mappings to X, so
using both systems on the same machine can be confusing. To make X use
the same buttons for select and paste operations as gpm, use the X
command
<P>
<BLOCKQUOTE><CODE>
xmodmap -e "pointer = 1 3 2"
</CODE></BLOCKQUOTE>
which causes the left button to select and the right button to paste,
for either 2-button or 3-button mice.
To force gpm to use the X standard button mapping, start it with a
<CODE>-B</CODE> command, eg:
<BLOCKQUOTE><CODE>
gpm -t msc -B 132
</CODE></BLOCKQUOTE>
<P>
<P>
<HR>
<A HREF="3-Button-Mouse-9.html">Next</A>
<A HREF="3-Button-Mouse-7.html">Previous</A>
<A HREF="3-Button-Mouse.html#toc8">Contents</A>
</BODY>
</HTML>