Article: 16625 of comp.os.linux.powerpc
From: Martin Costabel <costabel@wanadoo.fr>
Newsgroups: comp.os.linux.powerpc
Subject: Re: Solved 3 button mouse emulation problem
Date: Mon, 21 Jun 1999 00:43:50 +0200
Organization: Chez moi
Lines: 75
Message-ID: <376D6EA6.934C3702@wanadoo.fr>
References: <376C0E7B.15645B48@usa.net> <376C557C.85CF2FC0@earthlink.net> <376C737E.FD66E080@usa.net> <376CE742.4E36CB9B@wanadoo.fr> <1dtpgnd.1abedp71tkjc2cN@medusa.cwi.nl>
NNTP-Posting-Host: rennes-222.abo.wanadoo.fr
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: wanadoo.fr 929918654 3750 193.252.125.222 (20 Jun 1999 22:44:14 GMT)
X-Complaints-To: abuse@wanadoo.fr
NNTP-Posting-Date: 20 Jun 1999 22:44:14 GMT
To: Jeroen Scheerder <js@cwi.nl>
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.3.5 ppc)
X-Accept-Language: en
Path: news1.meer.net!news3.best.com!news2.best.com!news.maxwell.syr.edu!isdnet!wanadoo.fr!not-for-mail
Xref: news1.meer.net comp.os.linux.powerpc:16625

Jeroen Scheerder wrote:
> 
> Martin Costabel <costabel@wanadoo.fr>:
> 
> [XF68_FBDev doesn't have mouse button emulation -- use Xpmac instead]

I didn't quite say this. It's just different. And I am somewhat confused
right now as for the right way to do mouse button emulation in
XF68_FBDev. I know exactly what I did and that it works, but this
involves kernel patching (and I don't describe it here, because I did
this earlier). 

What you get from an unpatched kernel is not clear: Some people (some
from own experience, and even some experts) say that you can use the
kernel args "adb_buttons=1,xx,yy", i.e. adb_buttons with 3 parameters to
get opt+<xx>=button2 and opt+<yy>=button3, where <xx> is the key with
keycode xx. Keycodes are those that you get from showkey, not those from
xev. 

From my reading of the kernel sources (version 2.2.6 as in R5, or recent
vger sources), this is not true. I think if you want this, you have to
use a certain kernel patch which may or may not be included in some of
the precompiled kernels floating around. I hope one of the linuxppc guys
steps forward and explains this once and for all.

What I understand from the kernel sources (essentially the file
drivers/char/adbmouse.c), is the following (*please* correct me if I am
wrong):
With an unpatched kernel, you can use adb_buttons with 2 arguments, i.e.
"adb_buttons=xx,yy", to get <xx>=button2 and <yy>=button3. If you just
say "adb_buttons=1", then you get the default, namely xx=0x7d=125, which
is supposed to be ctrl_right and yy=0x7c=124 which is opt_right. If you
write "adb_buttons=1,xx,yy" with an unpatched kernel, you get a mixture
of the two, i.e. button3 is what you want, namely <yy>, whereas button2
remains the default, namely ctrl_right, independent of the value of xx.

There is another related problem that some people (including me) have
and others apparently don't: If you want to use any modifier key with
XF68_FBDev, you have to use the xkb mechanism, i.e. comment out the
XkbDisable line in XF86Config. In principle, if you don't do this (nice
triple negation: don't disable XkbDisable :-)), XF68_FBDev is supposed
to use the same keymap as the console, which it does, apart from the
modifier keys. This isn't a big problem for people with a standard US
keyboard, but for us poor foreigners, this means we have to use a second
foreign keymap with a completely different syntax from the one for the
console. And the supplied keymaps are not usable, of course.
 
> > Then go to /etc/X11 and say "ln -sf /usr/X11R6/bin/Xpmac X".
> 
> Good.  Configuration (XF86Config file) is identical?

No, AFAIK Xpmac does not look at any config file. It can be configured
using command line options as described in man Xpmac.
 
> The reason I'm asking is that, at present, I'm running a kernel that
> contains patches for the graphics adapter.  I have to boot it with
> additional parameters to recognize/support the graphics adapter
> properly.  And there's a heavily tweaked XF86Config file to match.
> 
> With all that, XF68_FBDev runs fine in 1024x768x32, with impressive
> graphics speed.  Can I just swap Xservers without any further changes,
> or will I have to use another kernel, other kernel parameters, another
> XF86Config file?

Helping a colleague to install R5 on his new B&W G3, I noticed also that
Xpmac is unstable. I don't know which window manager this was, I think
kde, any time he tried to move a window, the X server died. This is
something we had in pre-R5 and fvwm2 6 months ago, and it seems to
resurface. Maybe he has a particularly evil machine, we also didn't find
any kernel that would recognize his USB keyboard and mouse (and I don't
mean the keymap, it doesn't react at all, no installation possible
without adb keyboard). 

--
Martin


Article: 16606 of comp.os.linux.powerpc
From: Birch Browning <bpb3199@garnet.acns.fsu.edu>
Newsgroups: comp.os.linux.powerpc
Subject: Re: Emulating 3 buttons in R5?
Date: Sun, 20 Jun 1999 15:32:52 -0400
Organization: Florida State University
Lines: 36
Message-ID: <376D41E4.77FEEEEE@garnet.acns.fsu.edu>
References: <s.d.stokes-2006991224450001@22.albuquerque-06-07rs.nm.dial-access.att.net>
NNTP-Posting-Host: dial887.acns.fsu.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 4.6 (Macintosh; I; PPC)
X-Accept-Language: en
Path: news1.meer.net!news3.best.com!news1.best.com!144.212.100.101.MISMATCH!newsfeed.mathworks.com!logbridge.uoregon.edu!newsfeed.berkeley.edu!awabi.library.ucla.edu!134.139.1.31!csulb.edu!gatech!news.fsu.edu!news
Xref: news1.meer.net comp.os.linux.powerpc:16606

I found this in the interactive FAQ
(http://www.dartmouth.edu/~jonh/lppc-serve/cache/1.html) and it worked like a
charm on my PBG3. I actually find using the function keys nicer than the
opt-1 or opt-2, and I don't have to pass any kernel arguments in Boot X.


> If typing Option-2 and Option-3 for the middle and right mouse buttons respectively annoys you
> (these are the defaults, and yes I hate them), you can use xmodmap to change this.  Edit your
> startx file to have the following line:
>
>           serverargs="-nooptionmouse -middlekey 128 -rightkey 130"
>
> Your middle and right mouse buttons will be mapped toF1 and F2, respectively. Do "man
> xmodmap" for more details.
>
> -- Dan Caugherty (caffeine1@mindspring.com)
>
> caffeine1@mindspring.com
>
"Sheldon D. Stokes" wrote:

> I've been using MKLinux DR3 and LinuxPPC 4.1 both at home and at work.  I
> have both a mouse systems 3 button mouse and the original 1 button apple
> mouse.  I can't seem to get the middle and right mouse button on the mouse
> systems mouse to work in R5 and I can't seem to use the old <option><2>
> and <option><3> emulation keystrokes to work for the middle and right
> buttons on the apple mouse either.
>
> I've gone through a bunch of different combinations in mouseconfig.  What
> gives?  Do I have to do something really different with the new X server?
> If I go back to Xpmac will I get my other buttons?
>
> Thanks for your time
> Sheldon
> s.d.stokes@att.net



