[patch from Kelvin Delbarre] SDL's Quartz video implementation maps command

clicks to right-clicks and option-clicks to middle-clicks, a feature intended
for Mac users with single-button mice who are running SDL-based games that
require a multi-button mouse. This is unhelpful in SheepShaver, where we want
command-clicks and option-clicks to be passed through unchanged to the emulated
Mac OS. We can disable the unwanted behavior by setting an environment variable
SDL_HAS3BUTTONMOUSE intended for this very purpose.

A similar change in main_windows.cpp is NOT required, because only the Quartz
video implementation is involved.

By SDL convention, putenv is used in preference to setenv, although for Unix
platforms it doesn't matter.
This commit is contained in:
asvitkine 2008-06-22 20:30:12 +00:00
parent e8e2f3727a
commit d885e5ccf4

View File

@ -372,8 +372,11 @@ int main(int argc, char **argv)
bool memory_mapped_from_zero;
#ifdef USE_SDL_VIDEO
// don't let SDL block the screensaver
setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 1);
// Don't let SDL block the screensaver
putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1");
// Make SDL pass through command-clicks and option-clicks unaltered
putenv("SDL_HAS3BUTTONMOUSE=1");
#endif
// Initialize variables