3-button mouse on Mac OS X
Pascal Bourguignon
pjb at informatimago.com
Sun Jul 8 23:17:21 UTC 2001
> From: Doug Way <dway at riskmetrics.com>
>
> I've been considering doing more Squeak development while using OS X,
> either the Carbon or Cocoa version. It seems to work pretty well now,
> but there's still one obstacle -- I haven't figured out how to get my
> 3-button USB mouse to map properly to the option and command keys.
>
> This is more of an OS X problem than a Squeak problem, I guess, but has
> anyone gotten this to work? I used to use the shareware program USB
> Overdrive on OS9, which was great for mapping mouse buttons to modifier
> keys for different applications. (Actually, I'd settle for a simple
> global mapping now.) USB Overdrive hasn't been ported to OS X yet,
> though. The mouse I have is a newish Logitech 3-button scroll mouse,
> but the Logitech drivers don't seem to be OS X specific yet, either.
>
> Any ideas?
Well, I don't know if this will help you, because I've forked out to
Linux at the time Rhapsody appeared, but before that I did a NeXTSTEP
user interface for Squeak, where I handled the mouse button events and
mapped them to squeak three buttons.
See: http://www.informatimago.com/develop/squeak/index
mirrored at:
http://informatimago.free.fr/i/develop/squeak/index
http://hermes.afaa.asso.fr/users/pascal/develop/squeak/index
Unfortunately, this is a NeXTSTEP application, not an OpenStep,
therefore porting it to MacOSX would incur porting it first to
OpenStep.
However, having a look at the sources, you may be able to see what
should or could be done to resolve the problem.
That's perhaps a point that's ill-defined in OpenStep : there's no
provision for a variable number of mouse buttond. While for key
events, there are 16-bit key codes and char codes attributes in the
NSEvent objects, the left and right mouse buttons are distinguished by
event type.
In GNUstep, we had to add new event types for the middle button.
Now, how do they do in MacOSX? There's still only one mouse button on
Macintosh mice isn't there?
The NSEvent documentation of MacOSX explicitely notes:
Neither the OpenStep specification nor the Cocoa implementation
specifies facilities for the third button of a three-button mouse.
(http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSEvent.html)
Therefore there's no API to handle three buttons and you'll have to
talk to the mouse directly thru the USB driver to get the state of its
buttons, and generate the Squeak events independently from MacOSX
events.
http://gemma.apple.com/techpubs/macosx/Kernel/IOKitFundamentals/Families_Ref/index.html
--
__Pascal_Bourguignon__ (o_ Software patents are endangering
() ASCII ribbon against html email //\ the computer industry all around
/\ and Microsoft attachments. V_/ the world http://lpf.ai.mit.edu/
1962:DO20I=1.100 2001:my($f)=`fortune`; http://petition.eurolinux.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d? s++:++(+++)>++ a C+++ UB+++L++++$S+X++++>$ P- L+++ E++ W++
N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+)
DI+++ D++ G++ e+++ h+(++) r? y---? UF++++
------END GEEK CODE BLOCK------
More information about the Squeak-dev
mailing list
|