src/video/cocoa/SDL_cocoawindow.m
changeset 7915 86ad156a82ab
parent 7873 e88af17231bd
child 7946 57c34a54b7c2
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Nov 08 14:04:35 2013 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Nov 08 14:04:51 2013 -0800
     1.3 @@ -24,6 +24,7 @@
     1.4  
     1.5  #include "SDL_syswm.h"
     1.6  #include "SDL_timer.h"  /* For SDL_GetTicks() */
     1.7 +#include "SDL_hints.h"
     1.8  #include "../SDL_sysvideo.h"
     1.9  #include "../../events/SDL_keyboard_c.h"
    1.10  #include "../../events/SDL_mouse_c.h"
    1.11 @@ -59,6 +60,12 @@
    1.12      }
    1.13  }
    1.14  
    1.15 +static int GetHintCtrlClickEmulateRightClick()
    1.16 +{
    1.17 +	const char *hint = SDL_GetHint( SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK );
    1.18 +	return hint != NULL && *hint != '0';
    1.19 +}
    1.20 +
    1.21  @implementation Cocoa_WindowListener
    1.22  
    1.23  - (void)listen:(SDL_WindowData *)data
    1.24 @@ -341,7 +348,8 @@
    1.25  
    1.26      switch ([theEvent buttonNumber]) {
    1.27      case 0:
    1.28 -        if ([theEvent modifierFlags] & NSControlKeyMask) {
    1.29 +        if (([theEvent modifierFlags] & NSControlKeyMask) &&
    1.30 +		    GetHintCtrlClickEmulateRightClick()) {
    1.31              wasCtrlLeft = YES;
    1.32              button = SDL_BUTTON_RIGHT;
    1.33          } else {