Subject: Re: xServer
To: Peter Seebach <seebs@plethora.net>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-help
Date: 06/12/2000 17:33:48
On Mon, Jun 12, 2000 at 09:25:13AM -0500, Peter Seebach wrote:
> In message <20000612123039.B504@antioche.eu.org>, Manuel Bouyer writes:
> >Yes, it shoudl (didn't try yet :). You have to tweak XF86Config to get the
> >wheel work, however, just like for a PS/2 one (The ZAxisMapping thing)
> >and then resources for various applications (I can send you the ones for
> >xterm and netscape/mozilla).
> 
> Cool!  Could someone post the instructions?  I haven't seen 'em before, and
> I couldn't find  anything in the docs for wsmouse, etc.

Ok, so in /etc/XF86Config:
Section "Pointer"
    Protocol    "wsmouse"
    Device      "/dev/wsmouse0"
    ZAxisMapping 4 5
EndSection

This will map mouse movements to button 4 and 5. Now you just need to
teach apps to do something with there buttons: I have in my $HOME/.Xdefaults:
!# Scrolling on wheel mouse: half a page normally, line per line with shift
XTerm.vt100.translations: #override\n\
 Shift<Btn4Down>,<Btn4Up>:scroll-back(1,line)\n\
 Shift<Btn5Down>,<Btn5Up>:scroll-forw(1,line)\n\
 Ctrl<Btn4Down>,<Btn4Up>:scroll-back(1,page)\n\
 Ctrl<Btn5Down>,<Btn5Up>:scroll-forw(1,page)\n\
 <Btn4Down>,<Btn4Up>:scroll-back(1,halfpage)\n\
 <Btn5Down>,<Btn5Up>:scroll-forw(1,halfpage)\n\
!# In the scrollbar we map buttons 5 & 4 to 1 and 2 otherwise, core dump
!# This will move proportionnaly to cursor position but we dont know how to
!# program the same exact behavior as in the text widget.
XTerm.vt100.Scrollbar.translations: #override\n\
     <Btn5Down>: StartScroll(Forward)\n\
     <Btn4Down>: StartScroll(Backward)\n\

!## Athena text widgets
*Paned.Text.translations: #override\n\
 Shift<Btn4Down>,<Btn4Up>: scroll-one-line-down()\n\
 Shift<Btn5Down>,<Btn5Up>: scroll-one-line-up()\n\
 Ctrl<Btn4Down>,<Btn4Up>: previous-page()\n\
 Ctrl<Btn5Down>,<Btn5Up>: next-page()\n\
 None<Btn4Down>,<Btn4Up>:scroll-one-line-down()scroll-one-line-down()scroll-one-
line-down()scroll-one-line-down()scroll-one-line-down()\n\
 None<Btn5Down>,<Btn5Up>:scroll-one-line-up()scroll-one-line-up()scroll-one-line
-up()scroll-one-line-up()scroll-one-line-up()\n\

!## NETSCAPE
Netscape*drawingArea.translations:      #replace        \
        <Btn1Down>:                     ArmLink()       \n\
        <Btn2Down>:                     ArmLink()       \n\
        ~Shift<Btn1Up>:                 ActivateLink()  \n\
        ~Shift<Btn2Up>:                 ActivateLink(new-window)  \
                                        DisarmLink()    \n\
        Shift<Btn1Up>:                  ActivateLink(save-only)  \
                                        DisarmLink()    \n\
        Shift<Btn2Up>:                  ActivateLink(save-only)  \
                                        DisarmLink()    \n\
        <Btn1Motion>:                   DisarmLinkIfMoved()  \n\
        <Btn2Motion>:                   DisarmLinkIfMoved()  \n\
        <Btn3Motion>:                   DisarmLinkIfMoved()  \n\
        <Motion>:                       DescribeLink()  \n\
        <Btn3Down>:                     xfeDoPopup()    \n\
        <Btn3Up>:                       ActivatePopup() \n\
        Ctrl<Btn4Down>: PageUp()\n\
        Ctrl<Btn5Down>: PageDown()\n\
        Shift<Btn4Down>: LineUp()\n\
        Shift<Btn5Down>: LineDown()\n\
         None<Btn4Down>: LineUp()LineUp()LineUp()LineUp()LineUp()LineUp()\n\
         None<Btn5Down>: LineDown()LineDown()LineDown()LineDown()LineDown()LineDown()\n\
        Alt<Btn4Down>: xfeDoCommand(forward)\n\
        Alt<Btn5Down>: xfeDoCommand(back)\n

Netscape*globalNonTextTranslations: #override\n\
 Shift<Btn4Down>: LineUp()\n\
 Shift<Btn5Down>: LineDown()\n\
 None<Btn4Down>:LineUp()LineUp()LineUp()LineUp()LineUp()LineUp()\n\
 None<Btn5Down>:LineDown()LineDown()LineDown()LineDown()LineDown()LineDown()\n\
 Alt<Btn4Down>: xfeDoCommand(forward)\n\
 Alt<Btn5Down>: xfeDoCommand(back)\n


I found this on the web but I don't have the URLs any more :(
I think gnome applications handle the wheel out of the box, kde may too.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--