- X chapter, 11.9 mouse wheel:

* remove misleading instructions for using imwheel. Modern X clients
    support wheel natively, for years now
  * remove instructions for XFree3, mention Xorg here and there

Glanced over by:	brueffer
This commit is contained in:
Pav Lucistnik 2005-03-10 13:30:49 +00:00
parent 4d84d9362a
commit b121ae8473
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=24049

View file

@ -7405,71 +7405,21 @@ Device "/dev/sysmouse"
</question>
<answer>
<para>Yes. But you need to customize X client programs. See <ulink
url="http://www.inria.fr/koala/colas/mouse-wheel-scroll/">
Colas Nahaboo's web page
(http://www.inria.fr/koala/colas/mouse-wheel-scroll/)
</ulink>.</para>
<para>Yes.</para>
<para>If you want to use the <application>imwheel</application>
program, just follow these simple steps.</para>
<orderedlist>
<listitem>
<para>Translate the Wheel Events</para>
<para>The <application>imwheel</application> program
works by translating mouse button 4 and mouse button 5
events into key events. Thus, you have to get the
mouse driver to translate mouse wheel events to button
4 and 5 events. There are two ways of doing this, the
first way is to have &man.moused.8; do the
translation. The second way is for the X server
itself to do the event translation.</para>
<orderedlist>
<listitem>
<para>Using &man.moused.8; to Translate Wheel
Events</para>
<para>To have &man.moused.8; perform the event
translations, simply add <option>-z 4</option> to
the command line used to start &man.moused.8;.
For example, if you normally start &man.moused.8;
via <command>moused -p /dev/psm0</command> you
would start it by entering <command>moused -p
/dev/psm0 -z 4</command> instead. If you start
&man.moused.8; automatically during bootup via
<filename>/etc/rc.conf</filename>, you can simply
add <option>-z 4</option> to the
<varname>moused_flags</varname> variable in
<filename>/etc/rc.conf</filename>.</para>
<para>You now need to tell X that you have a 5
button mouse. To do this, simply add the line
<literal>Buttons 5</literal> to the
<quote>Pointer</quote> section of
<para>You need to tell X that you have a 5
button mouse. To do this, simply add the lines
<literal>Buttons 5</literal> and
<literal>ZAxisMapping 4 5</literal> to the
<quote>InputDevice</quote> section of
<filename>/etc/XF86Config</filename>. For
example, you might have the following
<quote>Pointer</quote> section in
<quote>InputDevice</quote> section in
<filename>/etc/XF86Config</filename>.</para>
<example>
<title><quote>Pointer</quote> Section for Wheeled
Mouse in &xfree86; 3.3.x series XF86Config with moused
Translation</title>
<programlisting>Section "Pointer"
Protocol "SysMouse"
Device "/dev/sysmouse"
Buttons 5
EndSection</programlisting>
</example>
<example>
<title><quote>InputDevice</quote> Section for Wheeled
Mouse in &xfree86; 4.x series XF86Config with X Server
Translation</title>
Mouse in &xfree86; and &xorg; configuration file</title>
<programlisting>Section "InputDevice"
Identifier "Mouse1"
@ -7477,171 +7427,18 @@ EndSection</programlisting>
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "Buttons" "5"
EndSection</programlisting>
</example>
<example>
<title><quote>.emacs</quote> example for naive
page scrolling with Wheeled Mouse</title>
<programlisting>;; wheel mouse
(global-set-key [mouse-4] 'scroll-down)
(global-set-key [mouse-5] 'scroll-up)</programlisting>
</example>
</listitem>
<listitem>
<para>Using Your X Server to Translate the Wheel
Events</para>
<para>If you are not running &man.moused.8;, or if
you do not want &man.moused.8; to translate your
wheel events, you can have the X server do the
event translation instead. This requires a couple
of modifications to your
<filename>/etc/XF86Config</filename> file. First,
you need to choose the proper protocol for your
mouse. Most wheeled mice use the
<quote>&intellimouse;</quote> protocol. However,
&xfree86; does support other protocols, such as
<quote>MouseManPlusPS/2</quote> for the Logitech
MouseMan+ mice. Once you have chosen the protocol
you will use, you need to add a
<varname>Protocol</varname> line to the
<quote>Pointer</quote> section.</para>
<para>Secondly, you need to tell the X server to
remap wheel scroll events to mouse buttons 4 and
5. This is done with the
<varname>ZAxisMapping</varname> option.</para>
<para>For example, if you are not using
&man.moused.8;, and you have an &intellimouse;
attached to the PS/2 mouse port you would use
the following in
<filename>/etc/XF86Config</filename>.</para>
<example>
<title><quote>Pointer</quote> Section for Wheeled
Mouse in <filename>XF86Config</filename> with X
Server Translation</title>
<programlisting>Section "Pointer"
Protocol "IntelliMouse"
Device "/dev/psm0"
ZAxisMapping 4 5
EndSection</programlisting>
</example>
<example>
<title><quote>InputDevice</quote> Section for Wheeled
Mouse in &xfree86; 4.x series XF86Config with X Server
Translation</title>
<programlisting>Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psm0"
Option "ZAxisMapping" "4 5"
EndSection</programlisting>
</example>
<example>
<title><quote>.emacs</quote> example for naive
page scrolling with Wheeled Mouse</title>
page scrolling with Wheeled Mouse (optional)</title>
<programlisting>;; wheel mouse
(global-set-key [mouse-4] 'scroll-down)
(global-set-key [mouse-5] 'scroll-up)</programlisting>
</example>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Install <application>imwheel</application></para>
<para>Next, install <application>imwheel</application>
from the Ports collection. It can be found in the
<filename>x11</filename> category. This program will
map the wheel events from your mouse into keyboard
events. For example, it might send <keycap>Page
Up</keycap> to a program when you scroll the wheel
forwards. <application>Imwheel</application> uses a
configuration file to map the wheel events to
key presses so that it can send different keys to
different applications. The default
<application>imwheel</application> configuration file
is installed in
<filename>/usr/X11R6/etc/imwheelrc</filename>. You
can copy it to <filename>~/.imwheelrc</filename> and
then edit it if you wish to customize
<application>imwheel</application>'s configuration.
The format of the configuration file is documented in
&man.imwheel.1;.</para>
</listitem>
<listitem>
<para>Configure <application>Emacs</application> to Work
with <application>Imwheel</application>
(<emphasis>optional</emphasis>)</para>
<para>If you use <application>emacs</application> or
<application>XEmacs</application>, then you need to
add a small section to your
<filename>~/.emacs</filename> file. For
<application>emacs</application>, add the
following:</para>
<example>
<title><application>Emacs</application> Configuration
for <application>Imwheel</application></title>
<programlisting>;;; For imwheel
(setq imwheel-scroll-interval 3)
(defun imwheel-scroll-down-some-lines ()
(interactive)
(scroll-down imwheel-scroll-interval))
(defun imwheel-scroll-up-some-lines ()
(interactive)
(scroll-up imwheel-scroll-interval))
(global-set-key [?\M-\C-\)] 'imwheel-scroll-up-some-lines)
(global-set-key [?\M-\C-\(] 'imwheel-scroll-down-some-lines)
;;; end imwheel section</programlisting>
</example>
<para>For <application>XEmacs</application>, add the
following to your <filename>~/.emacs</filename> file
instead:</para>
<example>
<title><application>XEmacs</application> Configuration
for <application>Imwheel</application></title>
<programlisting>;;; For imwheel
(mwheel-install)
(setq mwheel-follow-mouse t)
;;; end imwheel section</programlisting>
</example>
</listitem>
<listitem>
<para>Run <application>Imwheel</application></para>
<para>You can just type <command>imwheel</command>
in an xterm to start it up once it is installed. It
will background itself and take effect immediately.
If you want to always use
<application>imwheel</application>, simply add it to
your <filename>.xinitrc</filename> or
<filename>.xsession</filename> file. You can safely
ignore any warnings <application>imwheel</application>
displays about PID files. Those warnings only apply
to the &linux; version of
<application>imwheel</application>.</para>
</listitem>
</orderedlist>
</answer>
</qandaentry>