From d885e5ccf4408450dce1973ae9e06453b3a4de60 Mon Sep 17 00:00:00 2001 From: asvitkine <> Date: Sun, 22 Jun 2008 20:30:12 +0000 Subject: [PATCH] [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. --- SheepShaver/src/Unix/main_unix.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index d7329e2c..e9a8aea9 100644 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -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