Mac & mouse buttons

Hi,

I’m not sure if this is the right place to post this, if not please excuse me.

I have just ported “Exult” (an Ultima 7 remake) to the Mac. Now, my
problem is the lack of a second mouse button on the mac. A common way
to solve this problem in games is to use “Apple Key + Click” to
replace the right mouse button.

To acomplish this, I modified the two calls to SDL_PrivateMouseButton
in file “SDL_macevents.c” to look like this:

posted = SDL_PrivateMouseButton(
SDL_PRESSED,
(event.modifiers & cmdKey) ? 3 : 1,
event.where.h,
event.where.v);

Works like a charm!

Maybe it is worthwhile to integrate this into main SDL…

Bye,

Max–

Max “The Black Fingolfin” Horn
mailto:Max_Horn
http://www.quendi.de - please use my guestbook!

I have just ported “Exult” (an Ultima 7 remake) to the Mac. Now, my
problem is the lack of a second mouse button on the mac. A common way
to solve this problem in games is to use “Apple Key + Click” to
replace the right mouse button.

To acomplish this, I modified the two calls to SDL_PrivateMouseButton
in file “SDL_macevents.c” to look like this:

Works like a charm!

Maybe it is worthwhile to integrate this into main SDL…

I’d be happy to do this. Mac users, do you think this is worthwhile?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

-Sam Lantinga, Lead Programmer, Loki Entertainment Software

BTW, maybe I can get a jump on Maelstrom port to Mac. Maybe next week
or so, I’m working on another project right now.

Bye,

Max–

Max “The Black Fingolfin” Horn
mailto:Max_Horn
http://www.quendi.de - please use my guestbook!

X-Authentication-Warning: mail.lokigames.com: majordom set sender to owner-sdl at lokigames.com using -f
Sender: owner-sdl at lokigames.com
Precedence: bulk

I have just ported “Exult” (an Ultima 7 remake) to the Mac. Now, my
problem is the lack of a second mouse button on the mac. A common way
to solve this problem in games is to use “Apple Key + Click” to
replace the right mouse button.

I’d be happy to do this. Mac users, do you think this is worthwhile?

The standard “right mouse button” for context menus is control+click on
a Mac, so maybe this is a better choice. Also, I know that many Mac users
use mice with 2 or more buttons, where the right one is usually mapped
to the context menu, perhaps by emulating ctrl-click. On the other
hand, most game ports seem to use the Command (“Apple”/“Fornminne”) or
Option (“Alt”/“Sidetrack”) keys for the second button.

As far as I can tell, DrawSprockets allows games to use more than one
mouse button, so perhaps SDL already supports this?>From: Sam Lantinga

Date: Wed, 28 Jun 2000 09:13:21 -0700
Reply-To: sdl at lokigames.com

The standard “right mouse button” for context menus is control+click on
a Mac, so maybe this is a better choice.

Problem is that ctrl also exists on PC/Unix keyboards, so ctrl+click
might already be used for something else. This problem doesn’t exist
with the Apple Key, as it is specific to Apple.

Also, I know that many Mac users
use mice with 2 or more buttons, where the right one is usually mapped
to the context menu, perhaps by emulating ctrl-click.

By emulating ctrl-click usually, yes. But then, most mouse drivers
allow you to specify what happens upon a right-click. In fact, most
even allow you to define it on a per-application base

On the other
hand, most game ports seem to use the Command (“Apple”/“Fornminne”) or
Option (“Alt”/“Sidetrack”) keys for the second button.

I think it would be easy to add a compiler switch or so, that allows
to use ctrlKey instead of cmdKey. Or maybe even turn off the whole
thing!

Something like SDL_MAC_EMULATE_RIGHTBTN, and
SDL_MAC_EMULATE_RIGHTBTN_MODIFIER or so…

As far as I can tell, DrawSprockets allows games to use more than one
mouse button, so perhaps SDL already supports this?

But then you’re dependent upon DrawSprockets, which is a bad thing
IMHO - DrawSprockets suck badly!

Of course, this can be added, but please only optional.

Oh, and even better would be to add real InputSprocket support, which
would allow the user to map keys/button as they wish :slight_smile: (is there
Isp support in SDL yet?)

Bye,

Max–

Max “The Black Fingolfin” Horn
mailto:Max_Horn
http://www.quendi.de - please use my guestbook!

The standard “right mouse button” for context menus is control+click on
a Mac, so maybe this is a better choice.

Problem is that ctrl also exists on PC/Unix keyboards, so ctrl+click
might already be used for something else. This problem doesn’t exist
with the Apple Key, as it is specific to Apple.

I thought we were only implementing this in the Mac version of SDL? So does
it really matter if we use control?

As far as I can tell, DrawSprockets allows games to use more than one
mouse button, so perhaps SDL already supports this?

AFAIK DrawSprocket doesn’t do event handling, such as detecting mouse
buttons. You are thinking of InputSprocket.

But then you’re dependent upon DrawSprockets, which is a bad thing
IMHO - DrawSprockets suck badly!

You should reconsider. There is no better way to switch screen resolutions
on the current MacOS. That’s all DrawSprocket is really intended for anyway.

Oh, and even better would be to add real InputSprocket support, which
would allow the user to map keys/button as they wish :slight_smile: (is there
Isp support in SDL yet?)

There is ISp support for the joystick code. There is no ISp support for
keyboard and mouse in the joystick code. The keyboard and mouse events are
handled by the video subsystem.

As far as I can tell, DrawSprockets allows games to use more than one
mouse button, so perhaps SDL already supports this?

AFAIK DrawSprocket doesn’t do event handling, such as detecting mouse
buttons. You are thinking of InputSprocket.

DrawSprockets has a very simple func to detect mouse buttons IIRC.
Anyway, InputSprockets is the way to go.

But then you’re dependent upon DrawSprockets, which is a bad thing
IMHO - DrawSprockets suck badly!

You should reconsider. There is no better way to switch screen resolutions
on the current MacOS. That’s all DrawSprocket is really intended for anyway.

Well, DrawSprocket is also thought to be good for page flipping etc.,
and many ppl think it can be used to accelerate games - which is
wrong.

You’re right, the only thing DrawSprockets are actually usable for is
screen res switching. However, you don’t need it for this, you can
just use the DisplayManager (though Dsp is a bit easier to use, but
has less options)

Oh, and even better would be to add real InputSprocket support, which
would allow the user to map keys/button as they wish :slight_smile: (is there
Isp support in SDL yet?)

There is ISp support for the joystick code. There is no ISp support for
keyboard and mouse in the joystick code. The keyboard and mouse events are
handled by the video subsystem.

Hm, it would be really cool if Isp was supported for keyboard & mouse…

BTW, why is almost all of the mac stuff in the video subsystem, even
event handling? Shouldn’t that be in the event subsystem?

bye,

Max–

Max “The Black Fingolfin” Horn
mailto:Max_Horn
http://www.quendi.de - please use my guestbook!

Sam Lantinga wrote:

I have just ported “Exult” (an Ultima 7 remake) to the Mac. Now, my
problem is the lack of a second mouse button on the mac. A common way
to solve this problem in games is to use “Apple Key + Click” to
replace the right mouse button.

I’d be happy to do this. Mac users, do you think this is worthwhile?

Yes. I don’t know of an official Apple standard on this point, but
Command-click is guaranteed unique to Macs, while Control-click,
Shift-click, etc, may have bindings that the developer wants to be
consistent across all platforms.

There’s also some mnemonic value is that right button is often
used for commands, and the official name of the apple/clover key
is “Command”.

Stan

Max Horn wrote:

Anyway, InputSprockets is the way to go.

Unfortunately, InputSprockets are not in Carbon and therefore not
in Mac OS X either. There is supposedly some sort of replacement,
and I’m looking around at Apple for concrete info about it.

Stan

Anyway, InputSprockets is the way to go.

Unfortunately, InputSprockets are not in Carbon and therefore not
in Mac OS X either. There is supposedly some sort of replacement,
and I’m looking around at Apple for concrete info about it.

Also I hear that all the non-display switching features in DrawSprocket will
be taken out.

BTW, isn’t InputSprocket Open-sourced now? Surely someone will port it?