iMac Mouse Three Button Emulation: a solution

Albrecht Dreß ad at mpifr-bonn.mpg.de
Tue Feb 29 03:04:36 EST 2000


[I'm afraid the original post was lost?  SORRY if you read this for the third
time now...]

Hi all!

I wrote a patch for linux-pmac-stable, version 2.2.15pre-something which
enables an emulation for the 2nd and 3rd mouse button for the iMac single
button mouse (and possibly other machines with both USB keyboard and mouse).
In principle, it works like the "adb_buttons" stuff, simply catching two kb
events from the keyboard and generating mouse events instead (BTW, the
adb_buttons stuff will NOT work on the iMac, as some people suggested, as it
needs adb keyboard and mouse).

To install the patch, save the stuff below to a file, run "patch -b -p 1 <
file" in the linux source directory, and execute "make menuconfig" or "make
xconfig". If you enable the USB mouse, there is a new check item "Enable
three-button emulation". Check it, save the configuration and build and install
as usual. Add "usb_buttons=x,y" to the kernel parameters (e.g. in BootX), with
x and y set to the keycodes which shall emulate the middle and right button
respectively. The default is "usb_buttons=71,81" for the num lock and = keys
(on an iMac with german keyboard).  Use "showkey -k" to get the keycodes for
your favorite ones.

Please note that you should NOT activate this feature if you have a working
three-button USB mouse, as the code blocks any 2nd and 3rd mouse button events
and passes the emulated ones only. This behaviour is not nice, but I must
admit that I can not imagine a situation where this is really a problem, so I
omitted the code to fix this. An other point: the emulation does of course not
work if you do not have an USB keyboard, e.g. if you connect the iMac Mouse to
a Lombard PowerBook.

I did not test the patch thoroughly yet, but it seems to work fine. I hope that
this is an useful extension, and if there are other people than me who think
so, it might be a good idea to include it in the standard tree (Paul?)?

Yours, Albrecht.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: USB-Patch-2.2.15.gz
Type: application/octet-stream
Size: 1903 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20000228/41d99d32/attachment.obj>


More information about the Linuxppc-dev mailing list