src/video/cocoa/SDL_cocoawindow.m
changeset 12404 eb60e952b13f
parent 12339 86dcfbbcacaf
child 12405 5a95fbfd3617
equal deleted inserted replaced
12403:a4d730631698 12404:eb60e952b13f
  1101 {
  1101 {
  1102     NSSet *touches = [theEvent touchesMatchingPhase:phase inView:nil];
  1102     NSSet *touches = [theEvent touchesMatchingPhase:phase inView:nil];
  1103 
  1103 
  1104     for (NSTouch *touch in touches) {
  1104     for (NSTouch *touch in touches) {
  1105         const SDL_TouchID touchId = (SDL_TouchID)(intptr_t)[touch device];
  1105         const SDL_TouchID touchId = (SDL_TouchID)(intptr_t)[touch device];
  1106         if (SDL_AddTouch(touchId, "") < 0) {
  1106         SDL_TouchDeviceType devtype = SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE;
       
  1107 
       
  1108 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101202 /* Added in the 10.12.2 SDK. */
       
  1109         if ([touch respondsToSelector:@selector(type)]) {
       
  1110             if ([touch type] == NSTouchTypeDirect) {
       
  1111                 devtype = SDL_TOUCH_DEVICE_DIRECT;
       
  1112             }
       
  1113         }
       
  1114 #endif
       
  1115 
       
  1116         if (SDL_AddTouch(touchId, devtype, "") < 0) {
  1107             return;
  1117             return;
  1108         }
  1118         }
  1109 
  1119 
  1110         const SDL_FingerID fingerId = (SDL_FingerID)(intptr_t)[touch identity];
  1120         const SDL_FingerID fingerId = (SDL_FingerID)(intptr_t)[touch identity];
  1111         float x = [touch normalizedPosition].x;
  1121         float x = [touch normalizedPosition].x;