src/video/cocoa/SDL_cocoamouse.m
changeset 6950 1ddb72193079
parent 6885 700f1b25f77f
child 7037 3fedf1f25b94
equal deleted inserted replaced
6949:4de584a3a027 6950:1ddb72193079
   221          [event type] == NSLeftMouseDragged ||
   221          [event type] == NSLeftMouseDragged ||
   222          [event type] == NSRightMouseDragged ||
   222          [event type] == NSRightMouseDragged ||
   223          [event type] == NSOtherMouseDragged)) {
   223          [event type] == NSOtherMouseDragged)) {
   224         float x = [event deltaX];
   224         float x = [event deltaX];
   225         float y = [event deltaY];
   225         float y = [event deltaY];
   226         SDL_SendMouseMotion(mouse->focus, 1, (int)x, (int)y);
   226         SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, (int)x, (int)y);
   227     }
   227     }
   228 }
   228 }
   229 
   229 
   230 void
   230 void
   231 Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event)
   231 Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event)
   232 {
   232 {
       
   233     SDL_Mouse *mouse = SDL_GetMouse();
       
   234 
   233     float x = [event deltaX];
   235     float x = [event deltaX];
   234     float y = [event deltaY];
   236     float y = [event deltaY];
   235 
   237 
   236     if (x > 0) {
   238     if (x > 0) {
   237         x += 0.9f;
   239         x += 0.9f;
   241     if (y > 0) {
   243     if (y > 0) {
   242         y += 0.9f;
   244         y += 0.9f;
   243     } else if (y < 0) {
   245     } else if (y < 0) {
   244         y -= 0.9f;
   246         y -= 0.9f;
   245     }
   247     }
   246     SDL_SendMouseWheel(window, (int)x, (int)y);
   248     SDL_SendMouseWheel(window, mouse->mouseID, (int)x, (int)y);
   247 }
   249 }
   248 
   250 
   249 void
   251 void
   250 Cocoa_QuitMouse(_THIS)
   252 Cocoa_QuitMouse(_THIS)
   251 {
   253 {