Added an environment variable SDL_HAS3BUTTONMOUSE for Quartz
authorSam Lantinga <slouken@libsdl.org>
Sat, 05 Oct 2002 22:22:42 +0000
changeset 51179c189f5bd76
parent 510 875fbe29588d
child 512 fd7d603845dd
Added an environment variable SDL_HAS3BUTTONMOUSE for Quartz
docs.html
src/video/quartz/SDL_QuartzEvents.m
     1.1 --- a/docs.html	Sat Oct 05 20:26:34 2002 +0000
     1.2 +++ b/docs.html	Sat Oct 05 22:22:42 2002 +0000
     1.3 @@ -4,9 +4,13 @@
     1.4  
     1.5  <IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
     1.6  <P>
     1.7 -This source is in development.  It may contain API changes, and may not be
     1.8 -fully tested on all supported platforms.  The current stable release may
     1.9 -be found at the <A HREF="http://www.libsdl.org/"> main SDL page</A>.
    1.10 +This source is stable, and is fully tested on all supported platforms.<br>
    1.11 +Please send bug reports or questions to the SDL mailing list:<br>
    1.12 +<a href="http://www.libsdl.org/mailing-list.php"
    1.13 +        >http://www.libsdl.org/mailing-list.php</a><br>
    1.14 +The latest stable release may be found on the
    1.15 +	<a href="http://www.libsdl.org/">SDL website</A>.
    1.16 +</P>
    1.17  <P>
    1.18  
    1.19  <H2> <A HREF="docs/index.html">API Documentation</A> </H2>
    1.20 @@ -16,16 +20,62 @@
    1.21  Major changes since SDL 1.0.0:
    1.22  </H2>
    1.23  <UL>
    1.24 -	<LI> 1.2.5: Added initial support for Dreamcast (thanks HERO!)
    1.25 -	<LI> 1.2.5: Updated Borland projects for Kylix 3 (thanks Dominique)
    1.26 -	<LI> 1.2.5: Added project files for embedded Visual C++ 4.0
    1.27 -	<LI> 1.2.5: Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5)
    1.28 -	<LI> 1.2.5: Added SDL_GL_STEREO for stereoscopic OpenGL contexts
    1.29 -	<LI> 1.2.5: Fixed VidMode error when running on XFree86 3.3
    1.30 -	<LI> 1.2.5: Added initial support for PicoGUI (thanks Micah!)
    1.31 -	<LI> 1.2.5: Fixed SDL_DisplayFormatAlpha() on RGB surfaces with alpha
    1.32 -	<LI> 1.2.5: Fixed setting OpenGL mode multiple times on Windows
    1.33 -	<LI> 1.2.5: Added support for Qtopia on embedded systems (thanks David!)
    1.34 +	<LI> 1.2.5: Added an environment variable SDL_HAS3BUTTONMOUSE for Quartz
    1.35 +	<LI> 1.2.5: Added initial support for Dreamcast (thanks HERO!) 
    1.36 +	<LI> 1.2.5: Implemented resizing Cocoa windows (thanks Darrell!) 
    1.37 +	<LI> 1.2.5: Updated Quartz video code for MacOS X 10.2 (thanks Darrell!) 
    1.38 +	<LI> 1.2.5: Added an environment variable SDL_VIDEO_WINDOW_POS for X11
    1.39 +	<LI> 1.2.5: Fixed mouse focus problems caused by X11 'unclutter' hack 
    1.40 +	<LI> 1.2.5: Applied John's fix for left-handed mice under Windows. 
    1.41 +	<LI> 1.2.5: Gamepads and other HID devices should work under MacOS X 
    1.42 +	<LI> 1.2.5: Fixed missing cursor after shadow buffer flip (thanks Jan!) 
    1.43 +	<LI> 1.2.5: Updated MacOS projects with "enums as int" build option 
    1.44 +	<LI> 1.2.5: Added -benchmark flag to testvidinfo for testing video speed 
    1.45 +	<LI> 1.2.5: Added accelerated YUV code to DirectFB driver (thanks Denis!) 
    1.46 +	<LI> 1.2.5: Command line apps on MacOS X go to forground (thanks Max!) 
    1.47 +	<LI> 1.2.5: Fixed aRts runtime sound daemon detection 
    1.48 +	<LI> 1.2.5: Improved the Nano-X video support (thanks Greg!) 
    1.49 +	<LI> 1.2.5: Updated Borland projects for Kylix 3 (thanks Dominique) 
    1.50 +	<LI> 1.2.5: Added compile-time checking for the size of enums 
    1.51 +	<LI> 1.2.5: Fixed offset bug in hardware accelerated fills and blits 
    1.52 +	<LI> 1.2.5: Fixed serious bugs in BSD HID joystick code (thanks Krister!) 
    1.53 +	<LI> 1.2.5: Added project files for embedded Visual C++ 4.0 
    1.54 +	<LI> 1.2.5: Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5) 
    1.55 +	<LI> 1.2.5: Added SDL_GL_STEREO for stereoscopic OpenGL contexts 
    1.56 +	<LI> 1.2.5: Added the environment variable SDL_VIDEO_X11_WMCLASS 
    1.57 +	<LI> 1.2.5: Fullscreen windows are always topmost in Windows 
    1.58 +	<LI> 1.2.5: Fixed mouse grab going fullscreen to windowed in Windows 
    1.59 +	<LI> 1.2.5: Fixed VidMode error when running on XFree86 3.3 
    1.60 +	<LI> 1.2.5: Fixed Quartz mouse motion and window centering bugs 
    1.61 +	<LI> 1.2.5: Updated configure.in for automake 1.6.2 
    1.62 +	<LI> 1.2.5: Fixed building Windows DLL with latest native Cygwin tools 
    1.63 +	<LI> 1.2.5: Added a way to get the Windows OpenGL context in SDL_syswm.h 
    1.64 +	<LI> 1.2.5: Removed DDFLIP_WAIT flag from DirectX flip for performance 
    1.65 +	<LI> 1.2.5: Zeroed SDL_Surface::unused1 so glSDL will work on stock SDL 
    1.66 +	<LI> 1.2.5: Only modifier key state is noted when X11 window opens 
    1.67 +	<LI> 1.2.5: Added initial support for PicoGUI (thanks Micah!) 
    1.68 +	<LI> 1.2.5: Fixed SDL_DisplayFormatAlpha() on RGB surfaces with alpha 
    1.69 +	<LI> 1.2.5: Added pthread detection for HP-UX 11.X 
    1.70 +	<LI> 1.2.5: SDL_Init(SDL_INIT_JOYSTICK) on MacOS X works with no joystick 
    1.71 +	<LI> 1.2.5: Fixed DirectX software surface memory leak 
    1.72 +	<LI> 1.2.5: Fixed video initialization crash on Windows CE 
    1.73 +	<LI> 1.2.5: Updated the QNX audio code for QNX 6.2 (thanks Travis!) 
    1.74 +	<LI> 1.2.5: Fixed building with pthread and pth support on UNIX 
    1.75 +	<LI> 1.2.5: Added detection of several joysticks to Linux code 
    1.76 +	<LI> 1.2.5: Fixed thread detection and joystick code for NetBSD 
    1.77 +	<LI> 1.2.5: Added support for audio in the Atari port (thanks Patrice!) 
    1.78 +	<LI> 1.2.5: Added check for ENOMEDIUM to the Linux CDROM code 
    1.79 +	<LI> 1.2.5: Added YUV hardware acceleration on MacOS X (thanks Darrell!) 
    1.80 +	<LI> 1.2.5: Fixed building shared libraries on MacOS X (thanks Max!) 
    1.81 +	<LI> 1.2.5: Use secondary audio buffers in DirectSound by default 
    1.82 +	<LI> 1.2.5: Fixed window tab on Windows taskbar after application quit 
    1.83 +	<LI> 1.2.5: Fixed setting OpenGL mode multiple times on Windows 
    1.84 +	<LI> 1.2.5: Added Zaurus PDA (Qtopia) support by David Hedbor 
    1.85 +	<LI> 1.2.5: Removed README.OpenBSD - SDL works out of the box on OpenBSD 
    1.86 +	<LI> 1.2.5: Fixed crash in QZ_SetCaption() (thanks Darrell) 
    1.87 +	<LI> 1.2.5: Updated ALSA audio support for ALSA 0.9 
    1.88 +	<LI> 1.2.5: Don't build RPM archives with ALSA library dependencies 
    1.89 +	<LI> 1.2.5: SDL_PollEvent()/SDL_WaitEvent() return values now match docs 
    1.90  	<LI> 1.2.4: Added initial support for Atari (thanks Patrice!)
    1.91  	<LI> 1.2.4: Added support for building SDL for EPOC/SymbianOS 6.0
    1.92  	<LI> 1.2.4: SDL now compiles and works cleanly on stock BSDI
     2.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Sat Oct 05 20:26:34 2002 +0000
     2.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Sat Oct 05 22:22:42 2002 +0000
     2.3 @@ -19,6 +19,7 @@
     2.4      Sam Lantinga
     2.5      slouken@libsdl.org
     2.6  */
     2.7 +#include <stdlib.h>	// For getenv()
     2.8  #include "SDL_QuartzKeys.h"
     2.9  
    2.10  static void     QZ_InitOSKeymap (_THIS) {
    2.11 @@ -364,16 +365,20 @@
    2.12              switch (type) {
    2.13              
    2.14                  case NSLeftMouseDown:
    2.15 -                    if ( NSCommandKeyMask & current_mods ) {
    2.16 -                        last_virtual_button = 3;
    2.17 -                        DO_MOUSE_DOWN (3, 0);
    2.18 -                    }
    2.19 -                    else if ( NSAlternateKeyMask & current_mods ) {
    2.20 -                        last_virtual_button = 2;
    2.21 -                        DO_MOUSE_DOWN (2, 0);
    2.22 -                    }
    2.23 -                    else {
    2.24 +                    if ( getenv("SDL_HAS3BUTTONMOUSE") ) {
    2.25                          DO_MOUSE_DOWN (1, 1);
    2.26 +                    } else {
    2.27 +                        if ( NSCommandKeyMask & current_mods ) {
    2.28 +                            last_virtual_button = 3;
    2.29 +                            DO_MOUSE_DOWN (3, 0);
    2.30 +                        }
    2.31 +                        else if ( NSAlternateKeyMask & current_mods ) {
    2.32 +                            last_virtual_button = 2;
    2.33 +                            DO_MOUSE_DOWN (2, 0);
    2.34 +                        }
    2.35 +                        else {
    2.36 +                            DO_MOUSE_DOWN (1, 1);
    2.37 +                        }
    2.38                      }
    2.39                      break;
    2.40                  case NSOtherMouseDown: DO_MOUSE_DOWN (2, 0); break;