src/video/winrt/SDL_winrtpointerinput.cpp
changeset 9226 bea2e725e29a
parent 9220 1cb6ac648db7
child 9257 6f41196c2d6b
equal deleted inserted replaced
9225:5b97e1f05e53 9226:bea2e725e29a
   231         Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
   231         Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
   232         Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize);
   232         Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize);
   233 
   233 
   234         if (!WINRT_LeftFingerDown) {
   234         if (!WINRT_LeftFingerDown) {
   235             if (button) {
   235             if (button) {
   236                 SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
   236                 SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y);
   237                 SDL_SendMouseButton(window, 0, SDL_PRESSED, button);
   237                 SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, button);
   238             }
   238             }
   239 
   239 
   240             WINRT_LeftFingerDown = pointerPoint->PointerId;
   240             WINRT_LeftFingerDown = pointerPoint->PointerId;
   241         }
   241         }
   242 
   242 
   262 
   262 
   263     if ( ! WINRT_IsTouchEvent(pointerPoint)) {
   263     if ( ! WINRT_IsTouchEvent(pointerPoint)) {
   264         SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
   264         SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
   265     } else {
   265     } else {
   266         if (pointerPoint->PointerId == WINRT_LeftFingerDown) {
   266         if (pointerPoint->PointerId == WINRT_LeftFingerDown) {
   267             SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
   267             SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y);
   268         }
   268         }
   269 
   269 
   270         SDL_SendTouchMotion(
   270         SDL_SendTouchMotion(
   271             WINRT_TouchID,
   271             WINRT_TouchID,
   272             (SDL_FingerID) pointerPoint->PointerId,
   272             (SDL_FingerID) pointerPoint->PointerId,
   289     } else {
   289     } else {
   290         Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
   290         Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
   291 
   291 
   292         if (WINRT_LeftFingerDown == pointerPoint->PointerId) {
   292         if (WINRT_LeftFingerDown == pointerPoint->PointerId) {
   293             if (button) {
   293             if (button) {
   294                 SDL_SendMouseButton(window, 0, SDL_RELEASED, button);
   294                 SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_RELEASED, button);
   295             }
   295             }
   296             WINRT_LeftFingerDown = 0;
   296             WINRT_LeftFingerDown = 0;
   297         }
   297         }
   298     
   298     
   299         SDL_SendTouch(
   299         SDL_SendTouch(