comparison src/video/quartz/SDL_QuartzEvents.m @ 511:79c189f5bd76

Added an environment variable SDL_HAS3BUTTONMOUSE for Quartz
author Sam Lantinga <slouken@libsdl.org>
date Sat, 05 Oct 2002 22:22:42 +0000
parents 80a3d09bab29
children 2536446a92de
comparison
equal deleted inserted replaced
510:875fbe29588d 511:79c189f5bd76
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 #include <stdlib.h> // For getenv()
22 #include "SDL_QuartzKeys.h" 23 #include "SDL_QuartzKeys.h"
23 24
24 static void QZ_InitOSKeymap (_THIS) { 25 static void QZ_InitOSKeymap (_THIS) {
25 const void *KCHRPtr; 26 const void *KCHRPtr;
26 UInt32 state; 27 UInt32 state;
362 type = [ event type ]; 363 type = [ event type ];
363 isForGameWin = (qz_window == [ event window ]); 364 isForGameWin = (qz_window == [ event window ]);
364 switch (type) { 365 switch (type) {
365 366
366 case NSLeftMouseDown: 367 case NSLeftMouseDown:
367 if ( NSCommandKeyMask & current_mods ) { 368 if ( getenv("SDL_HAS3BUTTONMOUSE") ) {
368 last_virtual_button = 3;
369 DO_MOUSE_DOWN (3, 0);
370 }
371 else if ( NSAlternateKeyMask & current_mods ) {
372 last_virtual_button = 2;
373 DO_MOUSE_DOWN (2, 0);
374 }
375 else {
376 DO_MOUSE_DOWN (1, 1); 369 DO_MOUSE_DOWN (1, 1);
370 } else {
371 if ( NSCommandKeyMask & current_mods ) {
372 last_virtual_button = 3;
373 DO_MOUSE_DOWN (3, 0);
374 }
375 else if ( NSAlternateKeyMask & current_mods ) {
376 last_virtual_button = 2;
377 DO_MOUSE_DOWN (2, 0);
378 }
379 else {
380 DO_MOUSE_DOWN (1, 1);
381 }
377 } 382 }
378 break; 383 break;
379 case NSOtherMouseDown: DO_MOUSE_DOWN (2, 0); break; 384 case NSOtherMouseDown: DO_MOUSE_DOWN (2, 0); break;
380 case NSRightMouseDown: DO_MOUSE_DOWN (3, 0); break; 385 case NSRightMouseDown: DO_MOUSE_DOWN (3, 0); break;
381 case NSLeftMouseUp: 386 case NSLeftMouseUp: