src/video/cocoa/SDL_cocoawindow.m
changeset 12404 eb60e952b13f
parent 12339 86dcfbbcacaf
child 12405 5a95fbfd3617
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Wed Nov 07 07:52:39 2018 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Nov 10 16:15:48 2018 -0400
     1.3 @@ -1103,7 +1103,17 @@
     1.4  
     1.5      for (NSTouch *touch in touches) {
     1.6          const SDL_TouchID touchId = (SDL_TouchID)(intptr_t)[touch device];
     1.7 -        if (SDL_AddTouch(touchId, "") < 0) {
     1.8 +        SDL_TouchDeviceType devtype = SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE;
     1.9 +
    1.10 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101202 /* Added in the 10.12.2 SDK. */
    1.11 +        if ([touch respondsToSelector:@selector(type)]) {
    1.12 +            if ([touch type] == NSTouchTypeDirect) {
    1.13 +                devtype = SDL_TOUCH_DEVICE_DIRECT;
    1.14 +            }
    1.15 +        }
    1.16 +#endif
    1.17 +
    1.18 +        if (SDL_AddTouch(touchId, devtype, "") < 0) {
    1.19              return;
    1.20          }
    1.21